﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;
using System.Text.RegularExpressions;
using System.Threading;
using System.Reflection; // 引用这个才能使用Missing字段
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Xml;
using System.Web;
using System.Runtime.InteropServices;
using System.Net.Sockets;
using System.Net;
using System.IO;
using CCWin;
using Newtonsoft.Json;
using LitJson;
using Newtonsoft.Json.Linq;
using System.Data;
using System.Windows.Forms;

namespace weiqijiance.联网通信协议
{
    public class LWanche : LWbass
    {
        bool obdsc = false;
        WebReferenceCS.VeptsOutAccess m_vesd = new WebReferenceCS.VeptsOutAccess();
        public LWanche()
        {
            objdb = new 数据库操作.DBweiqi();
        }
        // 用于设置系统时间  
       
        //public mainform m_mainform;// { get; set; }
        public override void gettime()
        {
            WebReferenceCS.VeptsOutAccess m_vesd = new WebReferenceCS.VeptsOutAccess();
            m_vesd.Url = m_mainform.surl;

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            vehispara = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>
                                                <vehispara>
                                               
                                                </vehispara></root>",
                                                                m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                                "SJ001");
            string sjieguo = (m_vesd.query(vehispara));
            XmlDocument xmlstr = new XmlDocument();
            xmlstr.LoadXml(sjieguo);
            if (xmlstr.SelectSingleNode("/root/head/code").InnerText == "1")
            {
                string syndate = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/syndate").InnerText);//时间同行
                DateTime dt = DateTime.Parse(syndate.Substring(0, syndate.Length - 4));
                // 创建SystemTime结构体，用于接收用户设置的时间   
                mainform.SystemTime systemTime = new mainform.SystemTime();
                // 从setDate,setTime控件中获取年，月，日，小时，分钟，秒信息，存入SystemTime结构体中       
                systemTime.wYear = (ushort)dt.Year;
                systemTime.wMonth = (ushort)dt.Month;
                systemTime.wDay = (ushort)dt.Day;
                systemTime.wHour = (ushort)dt.Hour;
                systemTime.wMinute = (ushort)dt.Minute;
                systemTime.wSecond = (ushort)dt.Second;
                // 将系统的时间设置为用户指定的时间   
                mainform.SetLocalTime(ref systemTime);
                //MessageBox.Show(syndate);
            }
        }//时间同步

        public override void insertjcwc(string slsh)//检测完成标志
        {
            string sqlxzxx = string.Format(@"update DJ001 set  
                                                jcwc=1
                                                 where  jylsh='{0}' ",
                                                              slsh);

            m_mainform.objbass.objdb.InsertDB(sqlxzxx);
        }

        public override string sendOBDJCJG(string sjylsh)
        {
            string jyksrq = "";
            string jyjsrq = "";
            string jyy = "";
            string jyjg = "";
            string obdzdyscqy = "";
            string obdzdyxh = "";
            string vin = "";
            string obdyq = "";
            string gzjg = "";
            string tx = "";
            string txbz = "";
            string bj = "";
            string bjbz = "";
            string jxxm = "";
            string jxxmbz = "";
            string odometer = "";
            string odomil = "";
            string enginecalid = "";
            string enginecvn = "";
            string hclcalid = "";
            string hclcvn = "";
            string calid = "";
            string cvn = "";
            string iupr = "";
            //查询数据内容
            string sql;
            string gzm;

            sql = string.Format(@"select * from OBD_JCJG  where jylsh ='{0}'  order by OBD_JCJG_ID desc", sjylsh);// DateTime.Now.AddDays(-30), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            DataTable dt = m_mainform.objbass.objdb.GetTable(sql);
            if (dt.Rows.Count > 0)
            {

                jyksrq = dt.Rows[0]["OBD_JCJG_date"].ToString().Trim();
                jyjsrq = dt.Rows[0]["OBD_JCJG_date"].ToString().Trim();

                jyy = m_mainform.InspectionOperator;
                jyjg = "1";
                obdzdyscqy = m_mainform.OBDqiye;
                obdzdyxh = m_mainform.OBDname;

                string[] obdvin = dt.Rows[0]["OBD_JCJG_CLXX1"].ToString().Trim().Split(',');//发动机控制单元 CAL ID
                if (obdvin[0] != "")
                {
                    vin = obdvin[1];
                }
                else
                {
                    vin = "";
                }
                obdyq = "EOBD";
                gzjg = "1";
                bj = "1";
                bjbz = "";
                gzm = "";
                if (!obdsc)
                {
                    for (int i = 0; i < 7; i++)
                    {

                        if (dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim().Length > 0)
                        {
                            gzm = dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim();
                            if (bjbz.Length < 1)
                            {
                                bjbz = dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim();

                                if (gzm.Contains("P1683") || gzm.Contains("P0538") || gzm.Contains("P0481") || gzm.Contains("P0645") || gzm.Contains("预留") || gzm.Contains("null"))
                                {
                                    bjbz = "";
                                }
                            }
                            else
                            {

                                if (gzm.Contains("P1683") || gzm.Contains("P0538") || gzm.Contains("P0481") || gzm.Contains("P0645") || gzm.Contains("预留") || gzm.Contains("null"))
                                {
                                    bjbz = bjbz + "";
                                }
                                else
                                {
                                    bjbz = bjbz + dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim();
                                }

                            }
                        }


                    }
                    if (bjbz.Length > 0)
                    {
                        gzjg = "0";
                        bj = "0";
                        jyjg = "0";
                    }
                }


                tx = "1";
                txbz = "";


                jxxm = "1";
                jxxmbz = "";
                if (!obdsc)
                {
                    for (int i = 0; i < 10; i++)
                    {
                        int y = 0;
                        if (dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim().Contains("未完成"))
                        {
                            jxxm = "0";


                            if (bjbz.Length < 1)
                            {
                                jxxmbz = dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                            }
                            else
                            {
                                jxxmbz = bjbz + dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                            }
                            y++;
                        }
                        if (y > 2)
                        {
                            jyjg = "0";
                        }

                    }
                }
                for (int i = 0; i < 12; i++)
                {


                    if (dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Contains("里程表"))
                    {

                        string[] obdlc = dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Split(',');
                        if (obdlc[0] != "")
                        {
                            odometer = obdlc[1];
                        }
                        else
                        {
                            odometer = "";
                        }
                    }
                    if (dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Contains("点亮后的行驶距离"))
                    {
                        string[] obdlc = dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Split(',');
                        if (obdlc[0] != "")
                        {
                            odomil = obdlc[1];
                        }
                        else
                        {
                            odomil = "";
                        }
                    }
                }

                string[] obdcalid1 = dt.Rows[0]["OBD_JCJG_CLXX2"].ToString().Trim().Split(',');//发动机控制单元 CAL ID
                if (obdcalid1[0] != "")
                {
                    enginecalid = obdcalid1[1];
                }
                else
                {
                    enginecalid = "";
                }

                string[] obdvin1 = dt.Rows[0]["OBD_JCJG_CLXX3"].ToString().Trim().Split(',');//发动机控制单元 CVN
                if (obdvin1[0] != "")
                {
                    enginecvn = obdvin1[1];
                }
                else
                {
                    enginecvn = "";
                }

                hclcalid = "";
                hclcvn = "";

                if (dt.Rows[0]["OBD_JCJG_CLXX4"].ToString().Trim().Contains("CALID"))//其他发动机控制单元 CAL ID
                {
                    string[] obdcalid2 = dt.Rows[0]["OBD_JCJG_CLXX4"].ToString().Trim().Split(',');
                    if (obdcalid2[0] != "")
                    {
                        calid = obdcalid2[1];
                    }
                    else
                    {
                        calid = "";
                    }
                }
                else
                {
                    calid = "";
                }

                if (dt.Rows[0]["OBD_JCJG_CLXX5"].ToString().Trim().Contains("CVN"))//其他发动机控制单元 CAL ID
                {
                    string[] obdvin2 = dt.Rows[0]["OBD_JCJG_CLXX5"].ToString().Trim().Split(',');
                    if (obdvin2[0] != "")
                    {
                        cvn = obdvin2[1];
                    }
                    else
                    {
                        cvn = "";
                    }
                }
                else
                {
                    cvn = "";
                }


                for (int i = 0; i < 34; i++)
                {
                    if (dt.Rows[0][string.Format("OBD_JCJG_IUPR{0}", i + 1)].ToString().Trim().Length > 0)
                    {

                        //格式化iupr

                    }
                }

                ///
            }
            //

            //检测结果
            string vehisparajg = "";
            string stoubaojg = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubaojg = stoubaojg + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                     m_mainform.organ,
                                                    m_mainform.jkxlh,
                                                     "JC011");

            vehisparajg = stoubaojg + string.Format(@"<body><vehispara>
                                <jylsh>{0}</jylsh>
                                <testtimes>{1}</testtimes>
                                <jyksrq>{2}</jyksrq>
                                <jyjsrq>{3}</jyjsrq>
                                <jyy>{4}</jyy>
			                    <jyjg>{5}</jyjg>
			                    <obdzdyscqy>{6}</obdzdyscqy>
			                    <obdzdyxh>{7}</obdzdyxh>
			                    <vin>{8}</vin>
			                    <obdyq>{9}</obdyq>
			                    <gzjg>{10}</gzjg>
			                    <tx>{11}</tx>
			                    <txbz>{12}</txbz>
			                    <bj>{13}</bj>
			                    <bjbz>{14}</bjbz>
			                    <jxxm>{15}</jxxm>
                                <jxxmbz>{16}</jxxmbz>
                                <odometer>{17}</odometer>
                                <odomil>{18}</odomil>
                                <enginecalid>{19}</enginecalid>
                                <enginecvn>{20}</enginecvn>
                                <hclcalid>{21}</hclcalid>
                                <hclcvn>{22}</hclcvn>
                                <calid>{23}</calid>
                                <cvn>{24}</cvn>
                                <iupr>{25}</iupr>
                                 </vehispara>
			                    </body>
                                </root>",
                               mainform.businessId,
                               m_mainform.testtimes,
                               jyksrq,
                               jyjsrq,
                               jyy,
                               jyjg,
                               obdzdyscqy,
                               obdzdyxh,
                               vin,
                               obdyq,
                               gzjg,
                               tx,
                               txbz,
                               bj,
                               bjbz,
                               jxxm,
                               jxxmbz,
                               odometer,
                               odomil,
                               enginecalid,
                               enginecvn,
                               hclcalid,
                               hclcvn,
                               calid,
                               cvn,
                               iupr);

            //检测结果
            m_vesd.Url = m_mainform.surl;
            string sjg005 = m_vesd.write(vehisparajg);

            m_mainform.writetext("OBD上传", vehisparajg, m_mainform.slicense);
            m_mainform.writetext("OBD上传返回", m_mainform.decode(sjg005), m_mainform.slicense);

            return sjg005;
        }//OBD结果

        public override void getstandxz(string slsh)
        {
            if (mainform.methodId.Contains("DB") || mainform.methodId.Contains("双怠速"))//shaungdaishu双怠速
            {
                //SDS
                string sqlSDS;
                //if (mainform.shphm.Contains("贵"))
                if(true)
                {
                    sqlSDS = string.Format(@"Select *  from XZ001_SDS where lx='A' ");
                }
                else
                {
                    sqlSDS = string.Format(@"Select *  from XZ001_SDS  where lx='B' ");
                }
                DataTable dtSDS = objdb.GetTable(sqlSDS);
                if (dtSDS.Rows.Count > 0)
                {
                    float.TryParse(dtSDS.Rows[0]["dsco"].ToString().Trim(), out m_mainform.LICOL);
                    float.TryParse(dtSDS.Rows[0]["dshc"].ToString().Trim(), out m_mainform.LIHCL);
                    float.TryParse(dtSDS.Rows[0]["gdsco"].ToString().Trim(), out m_mainform.HICOL);
                    float.TryParse(dtSDS.Rows[0]["gdshc"].ToString().Trim(), out m_mainform.HIHCL);
                }
            }
            else if (mainform.methodId.Contains("WT") || mainform.methodId.Contains("ASM"))//ASM
            {
                //ASM
                string sql;
                sql = string.Format(@"Select *  from XZ001_ASM  ");
                if (true)
                //if (mainform.shphm.Contains("贵"))
                {
                    sql = string.Format(@"Select *  from XZ001_ASM  where lx='A'  ");
                }
                else
                {
                    sql = string.Format(@"Select *  from XZ001_ASM  where lx='B'  ");
                }
                DataTable dt = objdb.GetTable(sql);
                if (dt.Rows.Count > 0)
                {
                    float.TryParse(dt.Rows[0]["asm5025hc"].ToString().Trim(), out m_mainform.HCEL5025);
                    float.TryParse(dt.Rows[0]["asm5025co"].ToString().Trim(), out m_mainform.COEL5025);
                    float.TryParse(dt.Rows[0]["asm5025no"].ToString().Trim(), out m_mainform.NOEL5025);
                    float.TryParse(dt.Rows[0]["asm2540hc"].ToString().Trim(), out m_mainform.HCEL2540);
                    float.TryParse(dt.Rows[0]["asm2540co"].ToString().Trim(), out m_mainform.COEL2540);
                    float.TryParse(dt.Rows[0]["asm2540no"].ToString().Trim(), out m_mainform.NOEL2540);
                }
            }
            else if (mainform.methodId.Contains("LD") || mainform.methodId.Contains("加载"))//LUG
            {
                //LUG
                string sqlLUG;
                sqlLUG = string.Format(@"Select *  from XZ001_LUG");
                //if (mainform.shphm.Contains("贵"))
                    if (true)
                {
                    sqlLUG = string.Format(@"Select *  from XZ001_LUG where lx='A'");
                }
                else
                {
                    sqlLUG = string.Format(@"Select *  from XZ001_LUG where lx='B'");
                }
                DataTable dtLUG = objdb.GetTable(sqlLUG);
                if (dtLUG.Rows.Count > 0)
                {
                    for (int i = 0; i < dtLUG.Rows.Count; i++)
                    {
                        float.TryParse(dtLUG.Rows[i]["pfxz"].ToString().Trim(), out m_mainform.TypeApprovalLimits);
                        float.TryParse(dtLUG.Rows[i]["lugno"].ToString().Trim(), out m_mainform.noxlimit);


                    }
                }
            }
            else if (mainform.methodId.Contains("TG") || mainform.methodId.Contains("自由"))//ZYJS
            {
                //ZYJS
                string sqlZYJS;
                sqlZYJS = string.Format(@"Select *  from XZ001_ZYJS");
                //if (mainform.shphm.Contains("贵"))
                if (true)
                {
                    sqlZYJS = string.Format(@"Select *  from XZ001_ZYJS where lx='A'");
                }
                else
                {
                    sqlZYJS = string.Format(@"Select *  from XZ001_ZYJS where lx='B'");
                }
                DataTable dtZYJS = objdb.GetTable(sqlZYJS);
                if (dtZYJS.Rows.Count > 0)
                {
                    for (int i = 0; i < dtZYJS.Rows.Count; i++)
                    {
                        float.TryParse(dtZYJS.Rows[i]["pfxz"].ToString().Trim(), out m_mainform.InspectionLimits);
                    }
                }
            }
        }//获取限值

        public override string baocunclexxyj(string slsh)
        {         
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
              
            vehispara = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>
                                                <vehispara>
                                                <jylsh>{3}</jylsh>
                                                <testtimes>{4}</testtimes>
                                                </vehispara></root>",
                                                               m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                                "DL002",
                                                                slsh,
                                                                m_mainform.testtimes);
            m_vesd.Url = m_mainform.surl;
            string sjieguo = m_vesd.query(vehispara);
            XmlDocument xmlstr = new XmlDocument();
            xmlstr.LoadXml(sjieguo);
            if (xmlstr.SelectSingleNode("/root/head/code").InnerText == "1")
            {
                string gvm = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/gvm").InnerText);//最大总质量
                int igvm = 0;
                int.TryParse(gvm, out igvm);
                string sjcys = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/sjcys").InnerText);//座位数
                int izws = 0;
                int.TryParse(sjcys, out izws);
                string rm = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/rm").InnerText);//基准质量
                int irm = 0;
                int.TryParse(rm, out irm);

                string cllx = "一";//一类
                if (igvm > 3500)
                {
                    cllx = "重";//重型
                }
                else
                {
                    if (igvm > 2500)
                    {
                        cllx = "二";
                    }
                    else
                    {
                        if (izws < 7)
                        {
                            cllx = "一";//一类
                        }
                        else
                        {
                            cllx = "二";//2类
                        }
                    }
                }

                string mdate = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/mdate").InnerText);//出厂日期
                string fueltype = (xmlstr.SelectSingleNode("/root/body/vehispara/fueltype").InnerText);//燃油种类

                //保存数据方便上传接口使用
                m_mainform.testtimes = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/testtimes").InnerText);
                m_mainform.slicense = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/license").InnerText);
                m_mainform.slicensecode = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/licensecode").InnerText);
                m_mainform.odometer = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/odometer").InnerText);
                m_mainform.testtype = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/testtype").InnerText);
                string sjqfs = "";
                if (sjieguo.Contains("airin"))
                {
                    sjqfs = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/airin").InnerText); //airin//
                }
                string edgl = "";
                if (sjieguo.Contains("enginepower"))
                {
                    edgl = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/enginepower").InnerText); //enginepower//
                }
                string edzs = "5000";
                if (sjieguo.Contains("enginespeed"))
                {
                    edzs = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/enginespeed").InnerText); //enginepower//
                }
                if (cllx.Contains("重"))
                {
                    edzs = "3600";
                }
                else
                {
                    edzs = "5000";
                }
                string jzzl = "1100";
                if (sjieguo.Contains("rm"))
                {
                    jzzl = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/rm").InnerText); //enginepower//
                }
                string message = string.Format(@"号牌号码：{0} 号牌种类：{1} 最大总质量：{2} 座位数：{3} 基准质量：{4} 出厂日期：{5} 燃油种类：{6} 
                检测次数：{7} 里程表读数：{8} 检测方法：{9} 进气方式：{10} 发动机额定功率：{11} 发动机额定转速：{12}", m_mainform.slicense, m_mainform.slicensecode, gvm, sjcys, rm, mdate,
                                                                 fueltype, m_mainform.testtimes, m_mainform.odometer, m_mainform.testtype, sjqfs, edgl, edzs);
                m_mainform.baocunCLXX(m_mainform.slicense, "02", edgl, edzs, jzzl, cllx,"");
                m_mainform.writetext("车辆信息", message, m_mainform.slicense);
            }
            else
            {
                MessageBox.Show(m_mainform.decode(sjieguo));
                return "0";
            }
            return "1";
        }

        public override string start(string slsh, string stime, string sycy, string sczy, bool bqz)
        {
            obdsc = bqz;
            sendOBDJCJG(slsh);

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                //上传开始
                vehispara = stoubao + string.Format(@"<root><head>
                                                        <organ>{0}</organ>
                                                        <jkxlh>{1}</jkxlh>
                                                        <jkid>{2}</jkid>
                                                        </head>
                                                        <vehispara>
                                                        <jylsh>{3}</jylsh>
                                                        <testtimes>{4}</testtimes>
                                                        <tsno>{5}</tsno>
                                                        <testlineno>{6}</testlineno>
                                                        <license>{7}</license>
                                                        <licensecode>{8}</licensecode>
                                                        <jcjsy>{9}</jcjsy>
                                                        <jcczy>{10}</jcczy>
                                                        <zlkzy>{11}</zlkzy>
                                                        <sqr>{12}</sqr>
                                                        <testtype>{13}</testtype>
                                                        <odometer>{14}</odometer>
                                                        <dqsj>{15}</dqsj>
                                                        <jcbbh>{16}</jcbbh>
                                                        </vehispara></root>",
                                                        m_mainform.organ,
                                                        m_mainform.jkxlh,
                                                        "KS001",
                                                        slsh,
                                                        m_mainform.testtimes,
                                                        m_mainform.organ,
                                                        m_mainform.lineCode,
                                                        m_mainform.slicense,
                                                        m_mainform.slicensecode,
                                                        m_mainform.InspectionDriver,
                                                        m_mainform.InspectionOperator,
                                                        m_mainform.zhiliangkzy,
                                                        m_mainform.neishenyuan,
                                                        m_mainform.testtype,
                                                        m_mainform. odometer,
                                                        DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                                        "V4.0");
                m_vesd.Url = m_mainform.surl;
                string sKS001 = m_vesd.write(vehispara);
                if (!sKS001.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    MessageBox.Show(m_mainform.decode(sKS001));
                    return "0";
                }
                m_mainform.writetext("发送开始", vehispara, m_mainform.slicense);
                m_mainform.writetext("发送开始返回", m_mainform.decode(sKS001), m_mainform.slicense);

                return "1";     
        }

        public override bool stop(string sjylsh, string jyjg)
        {
            string vehisparajg = "";
            string stoubaojg = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubaojg = stoubaojg + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                    m_mainform.organ,
                                                    m_mainform.jkxlh,
                                                    "JS001");

            vehisparajg = stoubaojg + string.Format(@"<body><vehispara>
                                <jylsh>{0}</jylsh>
                                <testtimes>{1}</testtimes>
                                <tsno>{2}</tsno>
                                <testlineno>{3}</testlineno>
                                <license>{4}</license>
			                    <licensecode>{5}</licensecode>
                                <result>{6}</result>
                                 </vehispara>
			                    </body>
                                </root>",
                                sjylsh,
                                m_mainform.testtimes,
                                m_mainform.organ,
                                m_mainform.lineCode,
                                m_mainform.slicense,
                                m_mainform.slicensecode,
                                jyjg.Trim());
            m_vesd.Url = m_mainform.surl;
            string sKS005 = m_vesd.write(vehisparajg);
            if (!sKS005.ToUpper().Contains("<CODE>1</CODE>"))
            {

            }
            m_mainform.writetext("发送检验结束", vehisparajg, m_mainform.slicense);
            m_mainform.writetext("发送检验结束返回", m_mainform.decode(sKS005), m_mainform.slicense);

            return true;
        }

        public override string GetPic(string zpbh)
        {
            int bh = 0;
            int.TryParse(zpbh, out bh);
            if (bh > 100)
            {
                return "";
            }
            var result = "";
            string vehisparajg = "";
            string stoubaojg = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubaojg = stoubaojg + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                      m_mainform.organ,
                                                      m_mainform.jkxlh,
                                                     "ZP002");

            vehisparajg = stoubaojg + string.Format(@"<body><vehispara>
                                <jylsh>{0}</jylsh>
                                <testtimes>{1}</testtimes>
                                <tsno>{2}</tsno>
                                <testlineno>{3}</testlineno>
                                <zpbh>{4}</zpbh>
			                    <photo_date>{5}</photo_date>
                                 </vehispara>
			                    </body>
                                </root>",
                                mainform.businessId,
                                m_mainform.testtimes,
                                m_mainform.organ,
                                m_mainform.lineCode,
                                zpbh,
                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            m_vesd.Url =m_mainform.surl;
            result = m_vesd.write(vehisparajg);
            m_mainform.writetext("照片" + zpbh, vehisparajg, m_mainform.slicense);
            m_mainform.writetext("照片返回" + zpbh, result, m_mainform.slicense);

            return result;
        }

        public override DataTable getjilu(string shphm, string sdatestart, string sdateend,bool bbz)//获取登录车辆上线
        {
            string ztzw = "";
            getcheliangCS();
            string sql;

            if (shphm == "")
            {
                sql = string.Format(@" select * from DJ001 where DJ001.dlsj>'{0}' and DJ001.dlsj<'{1}' and (jcwc!=1 or jcwc is null)  order by DJ_ID desc", sdatestart, sdateend);
            }
            else
            {
                sql = string.Format(@" select * from DJ001 where DJ001.dlsj>'{0}' and DJ001.dlsj<'{1}' and license like '%%{2}%%' and (jcwc!=1 or jcwc is null)  order by DJ_ID desc", sdatestart, sdateend, shphm);
            }
            string sfujianqingk = "";
            DataTable dt = objdb.GetTable(sql);
            DataTable dtref = new DataTable();
            dtref.Columns.Add("DETECT_ID");
            dtref.Columns.Add("PLATE_ID");
            dtref.Columns.Add("PCLASS_ID");
            dtref.Columns.Add("jcff");
            dtref.Columns.Add("OBD");
            dtref.Columns.Add("jccs");
            dtref.Columns.Add("zt");
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow dr = dtref.NewRow();
                    dr[0] = dt.Rows[i]["jylsh"].ToString().Trim();    //填充第一列的数据 
                    dr[1] = dt.Rows[i]["license"].ToString().Trim();    //填充第一列的数据 
                    dr[2] = dt.Rows[i]["licensecode"].ToString().Trim();    //填充第一列的数据 
                    int icount = 0;
                    int.TryParse(dt.Rows[i]["testtimes"].ToString().Trim(), out icount);
                    string InspectionMethod = dt.Rows[i]["testtype"].ToString().Trim();
                    if (icount < 2)
                    {
                        sfujianqingk = "(初检)";
                    }
                    else
                    {
                        sfujianqingk = "(复检)";
                    }
                    if (InspectionMethod.Contains("1"))
                    {
                        dr[3] = string.Format("双怠速法{0}", sfujianqingk);
                    }
                    else if (InspectionMethod.Contains("5"))
                    {
                        dr[3] = string.Format("自由加速法{0}", sfujianqingk);
                    }
                    else if (InspectionMethod.Contains("2"))
                    {
                        dr[3] = string.Format("ASM工况法{0}", sfujianqingk);
                    }
                    else if (InspectionMethod.Contains("4"))
                    {
                        dr[3] = string.Format("加载减速法{0}", sfujianqingk);
                    }
                    dr[4] = dt.Rows[i]["obd"].ToString().Trim();
                    dr[5] =  string.Format("{0}", icount);
                    ztzw = dt.Rows[i]["zt"].ToString().Trim();
                    if (ztzw.Contains("0"))
                    {
                        ztzw = "待外观检测";
                    }
                    if (ztzw.Contains("1"))
                    {
                        ztzw = " 待OBD检测";
                    }
                    if (ztzw.Contains("2"))
                    {
                        ztzw = "待上线检测";
                    }
                    if (ztzw.Contains("3"))
                    {
                        ztzw = "上线检测中";
                    }
                    dr[6] = ztzw.ToString().Trim();
                    dtref.Rows.Add(dr);

                }
            }
            return dtref;
        }

        public void getcheliangCS()//
        {
            m_vesd.Url = m_mainform.surl;
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            vehispara = stoubao + string.Format("<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head><vehispara></vehispara></root>",
                m_mainform.organ,
                m_mainform.jkxlh,
                "DJ001",
                 DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            string sjieguo = m_vesd.query(vehispara);

            string ses = m_mainform.decode(sjieguo);

            XmlDocument xmlstr = new XmlDocument();
            xmlstr.LoadXml(sjieguo);
            XmlNode xn = xmlstr.SelectSingleNode("/root/body");
            // 得到根节点的所有子节点
            XmlNodeList xnl = xn.ChildNodes;

            foreach (XmlNode xn1 in xnl)
            {

                // 将节点转换为元素，便于得到节点的属性值
                XmlElement xe = (XmlElement)xn1;
                // 得到Type和ISBN两个属性的属性值

                // 得到节点的所有子节点
                XmlNodeList xnl0 = xe.ChildNodes;
                string tsno = xnl0.Item(0).InnerText; ;
                string jylsh = xnl0.Item(1).InnerText;
                string testtimes = xnl0.Item(2).InnerText;
                string license = m_mainform.decode(xnl0.Item(3).InnerText);
                string licensecode = m_mainform.decode(xnl0.Item(4).InnerText);
                string testtype = xnl0.Item(5).InnerText;
                string dlsj = m_mainform.decode(xnl0.Item(6).InnerText);
                string zt = xnl0.Item(7).InnerText;

                //存储下载的车辆信息
                string sqlxzxx = "";
                sqlxzxx = string.Format(@"select * from DJ001 where jylsh='{0}' and testtimes='{1}' order by DJ_ID desc ", jylsh, testtimes);
                if (m_mainform.objbass.objdb.selectDBcount(sqlxzxx) < 1)
                {
                    sqlxzxx = string.Format(@"insert into DJ001 (
                                                tsno,
                                                jylsh,
                                                testtimes,
                                                license,
                                                licensecode,
                                                testtype,
                                                dlsj,
                                                zt) values ('{0}',
                                                '{1}',
                                                '{2}',
                                                '{3}',
                                                '{4}',
                                                '{5}',
                                                '{6}',
                                                '{7}')",
                                            tsno,
                                            jylsh,
                                            testtimes,
                                            license,
                                            licensecode,
                                            testtype,
                                            dlsj,
                                            zt);

                }
                else
                {
                    sqlxzxx = string.Format(@"update  DJ001 set 
                                                tsno='{0}',
                                                license='{1}',
                                                licensecode='{2}',
                                                testtype='{3}',
                                                dlsj='{4}',
                                                zt='{5}' where jylsh='{6}' and  testtimes='{7}'",
                                            tsno,
                                            license,
                                            licensecode,
                                            testtype,
                                            dlsj,
                                            zt,
                                            jylsh,
                                            testtimes);

                }

                m_mainform.objbass.objdb.InsertDB(sqlxzxx);
                getautos(jylsh, testtimes);
            }
        }

        public void getautos(string slsh, string stime)
        {
            m_vesd.Url = m_mainform.surl;
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            vehispara = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>
                                                <vehispara>
                                                <jylsh>{3}</jylsh>
                                                <testtimes>{4}</testtimes>
                                                </vehispara></root>",
                                                                m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                                "DL002",
                                                                slsh,
                                                                stime);
            string sjieguo = m_vesd.query(vehispara);
            XmlDocument xmlstr = new XmlDocument();
            xmlstr.LoadXml(sjieguo);
            if (xmlstr.SelectSingleNode("/root/head/code").InnerText == "1")
            {
                string jylsh = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/jylsh").InnerText);//
                string testtimes = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/testtimes").InnerText);//
                string license = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/license").InnerText);//
                string licensetype = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/licensetype").InnerText);//
                string licensecode = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/licensecode").InnerText);//
                string vehicletype = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/vehicletype").InnerText);//
                string vehiclemodel = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/vehiclemodel").InnerText);//
                string cpmc = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/cpmc").InnerText);//
                string vin = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/vin").InnerText);//
                string clscqy = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/clscqy").InnerText);//
                string engine = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/engine").InnerText);//
                string enginemanuf = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/enginemanuf").InnerText);//
                string fdjh = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/fdjh").InnerText);//
                string ed = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/ed").InnerText);//
                //string enginespeed = decode(xmlstr.SelectSingleNode("/root/body/vehispara/enginespeed").InnerText);//
                //string enginepower = decode(xmlstr.SelectSingleNode("/root/body/vehispara/enginepower").InnerText);//
                //string usetype = decode(xmlstr.SelectSingleNode("/root/body/vehispara/usetype").InnerText);//
                //string registerdate = decode(xmlstr.SelectSingleNode("/root/body/vehispara/registerdate").InnerText);//
                //string mdate = decode(xmlstr.SelectSingleNode("/root/body/vehispara/mdate").InnerText);//
                //string owner = decode(xmlstr.SelectSingleNode("/root/body/vehispara/owner").InnerText);//
                //string lxdh = decode(xmlstr.SelectSingleNode("/root/body/vehispara/lxdh").InnerText);//
                //string lxdz = decode(xmlstr.SelectSingleNode("/root/body/vehispara/lxdz").InnerText);//
                //string standard = decode(xmlstr.SelectSingleNode("/root/body/vehispara/standard").InnerText);//
                //string gear = decode(xmlstr.SelectSingleNode("/root/body/vehispara/gear").InnerText);//
                //string airin = decode(xmlstr.SelectSingleNode("/root/body/vehispara/airin").InnerText);//
                //string fueltype = decode(xmlstr.SelectSingleNode("/root/body/vehispara/fueltype").InnerText);//
                //string fuelsupply = decode(xmlstr.SelectSingleNode("/root/body/vehispara/fuelsupply").InnerText);//
                //string drivemode = decode(xmlstr.SelectSingleNode("/root/body/vehispara/drivemode").InnerText);//
                //string gvm = decode(xmlstr.SelectSingleNode("/root/body/vehispara/gvm").InnerText);//
                //string rm = decode(xmlstr.SelectSingleNode("/root/body/vehispara/rm").InnerText);//
                //string zbzl = decode(xmlstr.SelectSingleNode("/root/body/vehispara/zbzl").InnerText);//
                //string egr = decode(xmlstr.SelectSingleNode("/root/body/vehispara/egr").InnerText);//
                //string hcl = decode(xmlstr.SelectSingleNode("/root/body/vehispara/hcl").InnerText);//
                //string hcltype = decode(xmlstr.SelectSingleNode("/root/body/vehispara/hcltype").InnerText);//
                //string dk = decode(xmlstr.SelectSingleNode("/root/body/vehispara/dk").InnerText);//
                //string tg = decode(xmlstr.SelectSingleNode("/root/body/vehispara/tg").InnerText);//
                //string hbflbz = decode(xmlstr.SelectSingleNode("/root/body/vehispara/hbflbz").InnerText);//
                //string testtype = decode(xmlstr.SelectSingleNode("/root/body/vehispara/testtype").InnerText);//
                //string rllb = decode(xmlstr.SelectSingleNode("/root/body/vehispara/rllb").InnerText);//
                //string fueltype1 = decode(xmlstr.SelectSingleNode("/root/body/vehispara/fueltype1").InnerText);//
                //string ambdadown = decode(xmlstr.SelectSingleNode("/root/body/vehispara/lambdadown").InnerText);//
                //string lambdaup = decode(xmlstr.SelectSingleNode("/root/body/vehispara/lambdaup").InnerText);//
                if (sjieguo.Contains("obd"))
                {

                    string Pdobd = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/obd").InnerText);//
                    if (Pdobd.Contains("Y"))
                    {

                        string sqlxzxx = string.Format(@"update DJ001 set  
                                                obd='{0}'
                                                 where  jylsh='{1}' ", "有",
                                                              slsh);

                        m_mainform.objbass.objdb.InsertDB(sqlxzxx);
                    }
                    else
                    {
                        string sqlxzxx = string.Format(@"update DJ001 set  
                                                obd='{0}'
                                                 where  jylsh='{1}' ", " ",
                                                             slsh);
                        m_mainform.objbass.objdb.InsertDB(sqlxzxx);
                    }
                }
                string ssql = string.Format("select * from Detects_SJE where ASM_JYLSH='{0}' and ITERAT={1}", jylsh, testtimes);
                if (m_mainform.objbass.objdb.selectDBcount(ssql) < 1)
                {
                    ssql = string.Format(@"insert into Detects_SJE (PLATE_ID,PCLASS_ID,ITERAT,ASM_JYLSH) values ('{0}','{1}',{2},'{3}')"
                        , license, licensecode, testtimes, jylsh);
                    m_mainform.objbass.objdb.InsertDB(ssql);
                }

            }
        }

        public override string sjuploadASM(string businessId, model.ASM.ASMsj objasmsj, model.ASM.ASMgcsj objasmgcsj, model.ASM.ASMobdgcsj objasmobd, int ics)
        {
            string message = "1";
            string cysx = "", hcclz = "", noclz = "", cs = "", zs = "", coclz = "", co2clz = "", o2clz = "", xsxzxs = "", sdxzxs = "",
                   jsgl = "", zsgl = "", jzgl = "", hjwd = "", dqyl = "", xdsd = "", yw = "", sjxl = "", nl = "", scfz = "",
                   jczt = "", glkqxs = "", noclzwxz = "", hcclzxzh = "", noclzxzh = "", coclzxzh = "", jcsj = "", gksj = "";
             

            string obdsjxl = "", jqmkd = "", fh = "", obdcs = "", qycgqxh = "", obdglkqxs = "", ymkd = "", fdjzs = "", jql = "",
                   jqyl = "", scgl = "", zyyl = "", hyl = "", no = "", nsbsl = "", pqwd = "", klbjqyc = "", egrkd = "", rypsyl = "";

            string hc2540limit = "", hc2540 = "", hc2540judge = "", co2540limit = "", co2540 = "", co2540judge = "", no2540limit = "", no2540 = "", no2540judge = "",
                   fdjzs2540 = "", fdjyw2540 = "", jzzgl2540 = "";


            int ids = objasmgcsj.count5025 + 1 ;
            if (objasmgcsj.count2540 > 1)
            {
                ids = ids + objasmgcsj.count2540 + 1 ;
            }
            for (int i = 0; i <= ids; i++)
            {
                obdsjxl = obdsjxl + objasmobd.Obdsjxl[i] + ",";
                jqmkd = jqmkd + objasmobd.ObdThrottle[i] + ",";
                fh = fh + objasmobd.ObdCLV[i] + ",";
                qycgqxh = qycgqxh + objasmobd.ObdPreOxygen[i] + ",";
                obdglkqxs = obdglkqxs + objasmobd.ObdExcessAirFactor[i] + ",";
                ymkd = ymkd + objasmobd.Obdymkd[i] + ",";
                obdcs = obdcs + objasmobd.ObdSpeed[i] + ",";
                fdjzs = fdjzs + objasmobd.ObdRPM[i] + ",";
                jql = jql + objasmobd.ObdAirInput[i] + ",";
                jqyl = jqyl + objasmobd.ObdAirPressure[i] + ",";
                scgl = scgl + objasmobd.Obdscgl[i] + ",";
                zyyl = zyyl + objasmobd.Obdzyyl[i] + ",";
                hyl = hyl + objasmobd.Obdhyl[i] + ",";
                no = no + objasmobd.Obdno[i] + ",";
                nsbsl = nsbsl + objasmobd.Obdnsbsl[i] + ",";
                pqwd = pqwd + objasmobd.Obdpqwd[i] + ",";
                klbjqyc = klbjqyc + objasmobd.Obdklbjqyc[i] + ",";
                egrkd = egrkd + objasmobd.Obdegrkd[i] + ",";
                rypsyl = rypsyl + objasmobd.Obdrypsyl[i] + ",";
            }
            obdsjxl = obdsjxl.Trim(',');
            sjxl = sjxl.Trim(',');
            jqmkd = jqmkd.Trim(',');
            fh = fh.Trim(',');
            qycgqxh = qycgqxh.Trim(',');
            obdglkqxs = obdglkqxs.Trim(',');
            ymkd = ymkd.Trim(',');
            obdcs = obdcs.Trim(',');
            fdjzs = fdjzs.Trim(',');
            jql = jql.Trim(',');
            jqyl = jqyl.Trim(',');
            scgl = scgl.Trim(',');
            zyyl = zyyl.Trim(',');
            hyl = hyl.Trim(',');
            no = no.Trim(',');
            nsbsl = nsbsl.Trim(',');
            pqwd = pqwd.Trim(',');
            klbjqyc = klbjqyc.Trim(',');
            egrkd = egrkd.Trim(',');
            rypsyl = rypsyl.Trim(',');

            for (int i = 0; i < objasmgcsj.count5025 + 1 ; i++)
            {
                if (i == 0)
                {
                    cysx = string.Format(@"{0}", i + 1);
                    cs = string.Format(@"{0}", objasmgcsj.m_SpeedGCSJ25[i].ToString("0.00"));
                    zs = string.Format(@"{0}", objasmgcsj.m_TrunGCSJ25[i]);
                    co2clz = string.Format(@"{0}", objasmgcsj.m_CO2GCSJ25[i]);
                    o2clz = string.Format(@"{0}", objasmgcsj.m_O2GCSJ25[i]);
                    xsxzxs = string.Format(@"{0}", objasmgcsj.m_DFGCSJ25[i].ToString("0.000")); ;
                    sdxzxs = string.Format(@"{0}", objasmgcsj.m_KHGCSJ25[i].ToString("0.000"));
                    jsgl = string.Format(@"{0}", 0.5f);
                    zsgl = string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    jzgl = string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    hjwd = string.Format(@"{0}", objasmgcsj.swendu25[i]);
                    dqyl = string.Format(@"{0}", objasmgcsj.sdaqiyi25[i]);
                    xdsd = string.Format(@"{0}", objasmgcsj.sshidu25[i]);
                    yw = string.Format(@"{0}", objasmgcsj.syouwen25[i]);

                    sjxl = string.Format(@"{0}", objasmgcsj.m_ProcessTime25[i].Length < 1 ? objasmgcsj.m_ProcessTime25[1] : objasmgcsj.m_ProcessTime25[i]);
                    nl = string.Format(@"{0}", objasmgcsj.m_NLGCSJ25[i]);
                    scfz = string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    jczt = string.Format(@"{0}", objasmgcsj.m_jcztGCSJ25[i]);

                    hcclz = string.Format(@"{0}", objasmgcsj.m_HCGCSJ25[i]);
                    noclz = string.Format(@"{0}", objasmgcsj.m_NOGCSJ25[i]);
                    coclz = string.Format(@"{0}", objasmgcsj.m_COGCSJ25[i]);

                    noclzwxz = string.Format(@"{0}", objasmgcsj.m_NOGCSJ25xzxs[i]);
                    hcclzxzh = string.Format(@"{0}", objasmgcsj.m_HCGCSJ25xz[i]);
                    noclzxzh = string.Format(@"{0}", objasmgcsj.m_NOGCSJ25xz[i]);
                    coclzxzh = string.Format(@"{0}", objasmgcsj.m_COGCSJ25xz[i]);
                    glkqxs = string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJ25[i]);
                    //jcsj = ids.ToString();
                    //gksj = ids.ToString();
                }
                else
                {
                    cysx = cysx + "," + string.Format(@"{0}", i + 1);
                    hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJ25[i]);
                    noclz = noclz + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ25[i]);
                    cs = cs + "," + string.Format(@"{0}", objasmgcsj.m_SpeedGCSJ25[i].ToString("0.00"));
                    zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJ25[i]);
                    coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJ25[i]);
                    co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJ25[i]);
                    o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJ25[i]);

                    xsxzxs = xsxzxs + "," + string.Format(@"{0}", objasmgcsj.m_DFGCSJ25[i].ToString("0.000")); ;
                    sdxzxs = sdxzxs + "," + string.Format(@"{0}", objasmgcsj.m_KHGCSJ25[i].ToString("0.000"));
                    jsgl = jsgl + "," + string.Format(@"{0}", 0.5f);
                    zsgl = zsgl + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    jzgl = jzgl + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.swendu25[i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.sdaqiyi25[i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.sshidu25[i]);
                    yw = yw + "," + string.Format(@"{0}", objasmgcsj.syouwen25[i]);
                    glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJ25[i]);
                    sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTime25[i]);
                    nl = nl + "," + string.Format(@"{0}", objasmgcsj.m_NLGCSJ25[i]);
                    scfz = scfz + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    if (i > objasmgcsj.count5025 - 10)
                    {
                        jczt = jczt + "," + "2";
                    }
                    else
                    {
                        if (i < 5)
                            jczt = jczt + "," + "0";
                        else
                            jczt = jczt + "," + "1";
                    }
                    noclzwxz = noclzwxz + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ25xzxs[i]);
                    hcclzxzh = hcclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJ25xz[i]);
                    noclzxzh = noclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ25xz[i]);
                    coclzxzh = coclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJ25xz[i]);
                    //jcsj = ids.ToString();
                    //gksj = ids.ToString();
                }
            }
            if (objasmsj.b2540)
            {
                for (int i = 0; i < objasmgcsj.count2540 + 1; i++)
                {
                    cysx = cysx + "," + string.Format(@"{0}", 95 + i + 1);
                    hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJ40[i]);
                    noclz = noclz + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ40[i]);
                    cs = cs + "," + string.Format(@"{0}", objasmgcsj.m_SpeedGCSJ40[i].ToString("0.00"));
                    zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJ40[i]);
                    coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJ40[i]);
                    co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJ40[i]);
                    o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJC40[i]);

                    xsxzxs = xsxzxs + "," + string.Format(@"{0}", objasmgcsj.m_DFGCSJ40[i].ToString("0.000")); ;
                    sdxzxs = sdxzxs + "," + string.Format(@"{0}", objasmgcsj.m_KHGCSJ40[i].ToString("0.000"));
                    jsgl = jsgl + "," + string.Format(@"{0}", 0.5f);
                    zsgl = zsgl + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ40[i].ToString("0.00"));
                    jzgl = jzgl + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ40[i].ToString("0.00"));
                    hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.swendu40[i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.sdaqiyi40[i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.sshidu40[i]);
                    yw = yw + "," + string.Format(@"{0}", objasmgcsj.syouwen40[i]);
                    glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJ40[i]);

                    sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTime40[i]);
                    nl = nl + "," + string.Format(@"{0}", objasmgcsj.m_NLGCSJ40[i]);
                    scfz = scfz + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ40[i].ToString("0.00"));
                    if (i < 5)
                    {
                        jczt = jczt + "," + "5";//加速过程
                    }
                    else
                    {
                        if (i > objasmgcsj.count2540 - 10)
                        {
                            jczt = jczt + "," + "4";
                        }
                        else
                        {
                            jczt = jczt + "," + "3";
                        }
                    }
                    noclzwxz = noclzwxz + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ40xzxs[i]);
                    hcclzxzh = hcclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJ40xz[i]);
                    noclzxzh = noclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ40xz[i]);
                    coclzxzh = coclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJ40xz[i]);
                }
                //jcsj = ids.ToString();
                //gksj = ids.ToString();

                hc2540limit = objasmsj.iHCXZ40.ToString();
                hc2540 = objasmsj.iHC40.ToString();
                hc2540judge = (objasmsj.iHC40 > objasmsj.iHCXZ40 ? 0 : 1).ToString();
                co2540limit = objasmsj.fCOXZ40.ToString("0.00");
                co2540 = objasmsj.fCO40.ToString("0.00");
                co2540judge = (objasmsj.fCO40 > objasmsj.fCOXZ40 ? 0 : 1).ToString();
                no2540limit = objasmsj.iNOXZ40.ToString();
                no2540 = objasmsj.iNO40.ToString();
                no2540judge = (objasmsj.iNO40 > objasmsj.iNOXZ40 ? 0 : 1).ToString();
                fdjzs2540 = objasmsj.fdjzs2540.ToString("0");
                fdjyw2540 = objasmsj.fdjyw2540.ToString("0.00");
                jzzgl2540 = objasmsj.jzzgl2540.ToString("0.0");
            }

            try
            {
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                               m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                               "GC011");

                vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <testtimes>{1}</testtimes>
                                            <cyds>{2}</cyds>
                                            <cysx>{3}</cysx>
                                            <sjxl>{4}</sjxl>
                                            <jqmkd>{5}</jqmkd>
                                            <fh>{6}</fh>
                                            <qycgqxh>{7}</qycgqxh>
                                            <glkqxs>{8}</glkqxs>
                                            <ymkd>{9}</ymkd>
                                            <cs>{10}</cs>
                                            <fdjzs>{11}</fdjzs>
                                            <jql>{12}</jql>
                                            <jqyl>{13}</jqyl>
                                            <scgl>{14}</scgl>
                                            <zyyl>{15}</zyyl>
                                            <hyl>{16}</hyl>
                                            <no>{17}</no>
                                            <nsbsl>{18}</nsbsl>
                                            <pqwd>{19}</pqwd>
                                            <klbjqyc>{20}</klbjqyc>
                                            <egrkd>{21}</egrkd>
                                            <rypsyr>{22}</rypsyr>
                                            <jczt>{23}</jczt>
                                             </vehispara>
			                                </body>
                                            </root>",
                                                businessId,
                                                m_mainform.testtimes,
                                                ids,
                                                cysx,
                                                obdsjxl,
                                                jqmkd,
                                                fh,
                                                qycgqxh,
                                                obdglkqxs,
                                                ymkd,
                                                obdcs,
                                                fdjzs,
                                                jql,
                                                jqyl,
                                                scgl,
                                                zyyl,
                                                hyl,
                                                no,
                                                nsbsl,
                                                pqwd,
                                                klbjqyc,
                                                egrkd,
                                                rypsyl,
                                                jczt);
                //过程数据
                m_vesd.Url = m_mainform.surl;
                if (mainform.obdzt.Contains("有"))
                {
                    string sgc011 = m_vesd.write(vehispara);
                    m_mainform.writetext("GC011", vehispara, m_mainform.slicense);
                    m_mainform.writetext("GC011返回", m_mainform.decode(sgc011), m_mainform.slicense);
                    if (!sgc011.ToUpper().Contains("<CODE>1</CODE>"))
                    {
                        message = "上传OBD过程数据失败 ";
                        return message;
                    }
                }
                vehispara = "";
                stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                               m_mainform.organ,
                                                              m_mainform.jkxlh,
                                                               "GC002");

                vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <testtimes>{1}</testtimes>
                                            <cyds>{2}</cyds>
                                            <cysx>{3}</cysx>
                                            <hcclz>{4}</hcclz>
                                            <noclz>{5}</noclz>
                                            <cs>{6}</cs>
                                            <zs>{7}</zs>
                                            <coclz>{8}</coclz>
                                            <co2clz>{9}</co2clz>
                                            <o2clz>{10}</o2clz>
                                            <xsxzxs>{11}</xsxzxs>
                                            <sdxzxs>{12}</sdxzxs>
                                            <jsgl>{13}</jsgl>
                                            <zsgl>{14}</zsgl>
                                            <jzgl>{15}</jzgl>
                                            <hjwd>{16}</hjwd>
                                            <dqyl>{17}</dqyl>
                                            <xdsd>{18}</xdsd>
                                            <yw>{19}</yw>
                                            <sjxl>{20}</sjxl>
                                            <nl>{21}</nl>
                                            <scfz>{22}</scfz>
                                            <jczt>{23}</jczt>
                                            <glkqxs>{24}</glkqxs>
                                            <noclzwxz>{25}</noclzwxz>
                                            <hcclzxzh>{26}</hcclzxzh>
                                            <noclzxzh>{27}</noclzxzh>
                                            <coclzxzh>{28}</coclzxzh>
                                            <jcsj>{29}</jcsj>
                                            <gksj>{30}</gksj>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                    businessId,
                                    m_mainform.testtimes,
                                    ids,
                                    cysx,
                                    hcclz,
                                    noclz,
                                    cs,
                                    zs,
                                    coclz,
                                    co2clz,
                                    o2clz,
                                    xsxzxs,
                                    sdxzxs,
                                    jsgl,
                                    zsgl,
                                    jzgl,
                                    hjwd,
                                    dqyl,
                                    xdsd,
                                    yw,
                                    sjxl,
                                    nl,
                                    scfz,
                                    jczt,
                                    glkqxs,
                                    noclzwxz,
                                    hcclzxzh,
                                    noclzxzh,
                                    coclzxzh,
                                    ids,
                                    ids);

                string sgc002 = m_vesd.write(vehispara);
                m_mainform.writetext("GC002", vehispara, m_mainform.slicense);
                m_mainform.writetext("GC002返回", m_mainform.decode(sgc002), m_mainform.slicense);

                if (!sgc002.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    message = "上传ASM过程数据失败 ";
                    return message;
                }

                vehispara = "";
                stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                             m_mainform.organ,
                                                            m_mainform.jkxlh,
                                                             "JC002");

                vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <testtimes>{1}</testtimes>
                                            <wd>{2}</wd>
                                            <dqy>{3}</dqy>
                                            <xdsd>{4}</xdsd>
			                                <hc5025limit>{5}</hc5025limit>
			                                <hc5025>{6}</hc5025>
			                                <hc5025judge>{7}</hc5025judge>
			                                <co5025limit>{8}</co5025limit>
			                                <co5025>{9}</co5025>
			                                <co5025judge>{10}</co5025judge>
			                                <no5025limit>{11}</no5025limit>
			                                <no5025>{12}</no5025>
			                                <no5025judge>{13}</no5025judge>
			                                <fdjzs5025>{14}</fdjzs5025>
			                                <fdjyw5025>{15}</fdjyw5025>
                                            <hc2540limit>{16}</hc2540limit>
                                            <hc2540>{17}</hc2540>
                                            <hc2540judge>{18}</hc2540judge>
                                            <co2540limit>{19}</co2540limit>
                                            <co2540>{20}</co2540>
                                            <co2540judge>{21}</co2540judge>
                                            <no2540limit>{22}</no2540limit>
                                            <no2540>{23}</no2540>
                                            <no2540judge>{24}</no2540judge>
                                            <fdjzs2540>{25}</fdjzs2540>
                                            <fdjyw2540>{26}</fdjyw2540>
                                            <jzzgl5025>{27}</jzzgl5025>
                                            <jzzgl2540>{28}</jzzgl2540>
                                            <result>{29}</result>
                                            <lambda>{30}</lambda>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                                businessId,
                                                m_mainform.testtimes,
                                                objasmsj.fwendu.ToString("0.00"),
                                                objasmsj.fdaqiya.ToString("0.00"),
                                                objasmsj.fshidu.ToString("0.00"),
                                                objasmsj.iHCXZ25,
                                                objasmsj.iHC25,
                                                (objasmsj.iHC25 > objasmsj.iHCXZ25 ? 0 : 1).ToString(),
                                                objasmsj.fCOXZ25.ToString("0.00"),
                                                objasmsj.fCO25.ToString("0.00"),
                                                (objasmsj.fCO25 > objasmsj.fCOXZ25 ? 0 : 1).ToString(),
                                                objasmsj.iNOXZ25,
                                                objasmsj.iNO25,
                                                (objasmsj.iNO25 > objasmsj.iNOXZ25 ? 0 : 1).ToString(),
                                                objasmsj.fdjzs5025,
                                                objasmsj.fdjyw5025.ToString("0.00"),
                                                hc2540limit,
                                                hc2540,
                                                hc2540judge,
                                                co2540limit,
                                                co2540,
                                                co2540judge,
                                                no2540limit,
                                                no2540,
                                                no2540judge,
                                                fdjzs2540,
                                                fdjyw2540,
                                                objasmsj.jzzgl5025.ToString("0.0"),
                                                jzzgl2540,
                                                objasmsj.result,
                                                objasmsj.lamda40.ToString("0.00"));


                //检测结果
                string sjc002 = m_vesd.write(vehispara);
                m_mainform.writetext("JC002", vehispara, m_mainform.slicense);
                m_mainform.writetext("JC002返回", m_mainform.decode(sjc002), m_mainform.slicense);

                if (!sjc002.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    message = "上传ASM结果数据失败 ";
                    return message;
                }
            }
            catch (Exception ex)
            {
                m_mainform.writetext("上传数据失败", ex.ToString(), m_mainform.slicense);
                message = "上传内容出现错误";
                return message;
            }
            return message;
        }

        public override string sjuploadSDS(string businessId, model.SDS.SDSsj objasmsj, model.SDS.SDSgcsj objasmgcsj, model.ASM.ASMobdgcsj objasmobd)
        {
            string message = "1";
            string cysx = "", hcclz = "", zs = "", coclz = "", glkqxs = "", sjxl = "", yw = "", co2clz = "", o2clz = "", hjwd = "", dqyl = "", xdsd = "", jczt = "",
                   jcsj = "", gksj = "";

            string obdsjxl = "", jqmkd = "", fh = "", obdcs = "", qycgqxh = "", obdglkqxs = "", ymkd = "", fdjzs = "", jql = "",
                  jqyl = "", scgl = "", zyyl = "", hyl = "", no = "", nsbsl = "", pqwd = "", klbjqyc = "", egrkd = "", rypsyl = "";

            for (int i = 0; i <= objasmobd.Obdiobd; i++)
            {
                obdsjxl = obdsjxl + objasmobd.Obdsjxl[i] + ",";
                jqmkd = jqmkd + objasmobd.ObdThrottle[i] + ",";
                fh = fh + objasmobd.ObdCLV[i] + ",";
                qycgqxh = qycgqxh + objasmobd.ObdPreOxygen[i] + ",";
                obdglkqxs = obdglkqxs + objasmobd.ObdExcessAirFactor[i] + ",";
                ymkd = ymkd + objasmobd.Obdymkd[i] + ",";
                obdcs = obdcs + objasmobd.ObdSpeed[i] + ",";
                fdjzs = fdjzs + objasmobd.ObdRPM[i] + ",";
                jql = jql + objasmobd.ObdAirInput[i] + ",";
                jqyl = jqyl + objasmobd.ObdAirPressure[i] + ",";
                scgl = scgl + objasmobd.Obdscgl[i] + ",";
                zyyl = zyyl + objasmobd.Obdzyyl[i] + ",";
                hyl = hyl + objasmobd.Obdhyl[i] + ",";
                no = no + objasmobd.Obdno[i] + ",";
                nsbsl = nsbsl + objasmobd.Obdnsbsl[i] + ",";
                pqwd = pqwd + objasmobd.Obdpqwd[i] + ",";
                klbjqyc = klbjqyc + objasmobd.Obdklbjqyc[i] + ",";
                egrkd = egrkd + objasmobd.Obdegrkd[i] + ",";
                rypsyl = rypsyl + objasmobd.Obdrypsyl[i] + ",";
            }
            obdsjxl = obdsjxl.Trim(',');
            sjxl = sjxl.Trim(',');
            jqmkd = jqmkd.Trim(',');
            fh = fh.Trim(',');
            qycgqxh = qycgqxh.Trim(',');
            obdglkqxs = obdglkqxs.Trim(',');
            ymkd = ymkd.Trim(',');
            obdcs = obdcs.Trim(',');
            fdjzs = fdjzs.Trim(',');
            jql = jql.Trim(',');
            jqyl = jqyl.Trim(',');
            scgl = scgl.Trim(',');
            zyyl = zyyl.Trim(',');
            hyl = hyl.Trim(',');
            no = no.Trim(',');
            nsbsl = nsbsl.Trim(',');
            pqwd = pqwd.Trim(',');
            klbjqyc = klbjqyc.Trim(',');
            egrkd = egrkd.Trim(',');
            rypsyl = rypsyl.Trim(',');

            for (int i = 0; i < 30; i++)
            {
                if (i == 0)
                {
                    cysx = string.Format(@"{0}", i + 1);
                    hcclz = string.Format(@"{0}", objasmgcsj.m_HCGCSJYR[i]);
                    zs = string.Format(@"{0}", objasmgcsj.m_TrunGCSJYR[i]);
                    coclz = string.Format(@"{0}", objasmgcsj.m_COGCSJYR[i]);
                    glkqxs = string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJYR[i]);
                    sjxl = string.Format(@"{0}", objasmgcsj.m_ProcessTimeYR[i]);
                    yw = string.Format(@"{0}", objasmgcsj.m_YWGCSJYR[i].ToString("0.0"));
                    co2clz = string.Format(@"{0}", objasmgcsj.m_CO2GCSJYR[i]);
                    o2clz = string.Format(@"{0}", objasmgcsj.m_O2GCSJYR[i]);
                    hjwd = string.Format(@"{0}", objasmgcsj.m_wendu[i]);
                    dqyl = string.Format(@"{0}", objasmgcsj.m_daqiya[i]);
                    xdsd = string.Format(@"{0}", objasmgcsj.m_shidu[i]);
                    jczt = string.Format(@"{0}", 0);
                }
                else
                {
                    cysx = cysx + "," + string.Format(@"{0}", i + 1);
                    hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJYR[i]);
                    zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJYR[i]);
                    coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJYR[i]);
                    glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJYR[i]);
                    yw = yw + "," + string.Format(@"{0}", objasmgcsj.m_YWGCSJYR[i].ToString("0.0"));
                    co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJYR[i]);
                    o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJYR[i]);
                    hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.m_wendu[i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.m_daqiya[i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.m_shidu[i]);
                    sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTimeYR[i]);
                    jczt = jczt + "," + string.Format(@"{0}", 0);
                }
            }
            for (int i = 0; i < 15; i++)
            {
                cysx = cysx + "," + string.Format(@"{0}", i + 1 + 30);
                hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJG15[i]);
                zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJG15[i]);
                coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJG15[i]);
                glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJG15[i]);
                yw = yw + "," + string.Format(@"{0}", objasmgcsj.m_YWGCSJG15[i].ToString("0.0"));
                co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJG15[i]);
                o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJG15[i]);
                hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.m_wendu[30 + i]);
                dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.m_daqiya[30 + i]);
                xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.m_shidu[30 + i]);

                sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTimeG15[i]);
                jczt = jczt + "," + string.Format(@"{0}", 1);

            }
            for (int i = 0; i < 30; i++)
            {
                cysx = cysx + "," + string.Format(@"{0}", i + 1 + 30 + 15);
                hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJG[i]);

                if (objasmgcsj.m_TrunGCSJG[i] > 100)
                {
                    if (objasmgcsj.scllx.Contains("重"))
                    {
                        if (objasmgcsj.m_TrunGCSJG[i] > 2000 || objasmgcsj.m_TrunGCSJG[i] < 1600)
                        {
                            objasmgcsj.m_TrunGCSJG[i] = 1830 + 10 * m_mainform.getRandom(0, 3) + m_mainform.getRandom(0, 9);
                        }
                    }
                    else
                    {
                        if (objasmgcsj.m_TrunGCSJG[i] > 2600 || objasmgcsj.m_TrunGCSJG[i] < 2400)
                        {
                            objasmgcsj.m_TrunGCSJG[i] = 2430 + 10 * m_mainform.getRandom(0, 3) + m_mainform.getRandom(0, 9);
                        }
                    }
                }

                zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJG[i]);
                coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJG[i]);
                glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJG[i]);
                yw = yw + "," + string.Format(@"{0}", objasmgcsj.m_YWGCSJG[i].ToString("0.0"));
                co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJG[i]);
                o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJG[i]);
                hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.m_wendu[30 + 15 + i]);
                dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.m_daqiya[30 + 15 + i]);
                xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.m_shidu[30 + 15 + i]);
                sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTimeG[i]);
                jczt = jczt + "," + string.Format(@"{0}", 2);
            }
            gksj = "30,15,30";
            jcsj = "75";
            if (objasmobd.Obdiobd > 74)
            {
                for (int i = 0; i < 15; i++)
                {
                    cysx = cysx + "," + string.Format(@"{0}", i + 1 + 30 + 15 + 30);
                    hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJD15[i]);
                    zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJD15[i]);
                    coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJD15[i]);
                    glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJD15[i]);
                    yw = yw + "," + string.Format(@"{0}", objasmgcsj.m_YWGCSJD15[i].ToString("0.0"));
                    co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJD15[i]);
                    o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJD15[i]);
                    hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.m_wendu[30 + 15 + 30 + i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.m_daqiya[30 + 15 + 30 + i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.m_shidu[30 + 15 + 30 + i]);
                    sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTimeD15[i]);
                    jczt = jczt + "," + string.Format(@"{0}", 3);
                }
                for (int i = 0; i < 30; i++)
                {
                    cysx = cysx + "," + string.Format(@"{0}", i + 1 + 30 + 15 + 30 + 15);
                    hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJD[i]);
                    zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJD[i]);
                    coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJD[i]);
                    glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJD[i]);
                    yw = yw + "," + string.Format(@"{0}", objasmgcsj.m_YWGCSJD[i].ToString("0.0"));
                    co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJD[i]);
                    o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJD[i]);
                    hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.m_wendu[30 + 15 + 45 + i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.m_daqiya[30 + 15 + 45 + i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.m_shidu[30 + 15 + 45 + i]);
                    sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTimeD[i]);
                    jczt = jczt + "," + string.Format(@"{0}", 4);
                }
                gksj = "30,15,30,15,30";
                jcsj = "120";
            }
            try
            {
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                               m_mainform.organ,
                                                              m_mainform.jkxlh,
                                                               "GC011");

                vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <testtimes>{1}</testtimes>
                                            <cyds>{2}</cyds>
                                            <cysx>{3}</cysx>
                                            <sjxl>{4}</sjxl>
                                            <jqmkd>{5}</jqmkd>
                                            <fh>{6}</fh>
                                            <qycgqxh>{7}</qycgqxh>
                                            <glkqxs>{8}</glkqxs>
                                            <ymkd>{9}</ymkd>
                                            <cs>{10}</cs>
                                            <fdjzs>{11}</fdjzs>
                                            <jql>{12}</jql>
                                            <jqyl>{13}</jqyl>
                                            <scgl>{14}</scgl>
                                            <zyyl>{15}</zyyl>
                                            <hyl>{16}</hyl>
                                            <no>{17}</no>
                                            <nsbsl>{18}</nsbsl>
                                            <pqwd>{19}</pqwd>
                                            <klbjqyc>{20}</klbjqyc>
                                            <egrkd>{21}</egrkd>
                                            <rypsyr>{22}</rypsyr>
                                            <jczt>{23}</jczt>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                    businessId,
                                    m_mainform.testtimes,
                                    objasmobd.Obdiobd + 1,
                                    cysx,
                                    obdsjxl,
                                    jqmkd,
                                    fh,
                                    qycgqxh,
                                    obdglkqxs,
                                    ymkd,
                                    obdcs,
                                    fdjzs,
                                    jql,
                                    jqyl,
                                    scgl,
                                    zyyl,
                                    hyl,
                                    no,
                                    nsbsl,
                                    pqwd,
                                    klbjqyc,
                                    egrkd,
                                    rypsyl,
                                    jczt);

                //过程数据

                m_vesd.Url = m_mainform.surl;
                if (mainform.obdzt.Contains("有"))
                {
                    string sgc011 = m_vesd.write(vehispara);
                    m_mainform.writetext("GC011", vehispara, m_mainform.slicense);
                    m_mainform.writetext("GC011返回", m_mainform.decode(sgc011), m_mainform.slicense);
                    if (!sgc011.ToUpper().Contains("<CODE>1</CODE>"))
                    {
                        message = "上传OBD过程数据失败 ";
                        return message;
                    }
                }

                vehispara = "";
                stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                                  m_mainform.organ,
                                                                 m_mainform.jkxlh,
                                                                  "GC003");
                vehispara = stoubao + string.Format(@"<body><vehispara>
                               <jylsh>{0}</jylsh>
                                <testtimes>{1}</testtimes>
                                <cyds>{2}</cyds>
                                <cysx>{3}</cysx>
                                <hcclz>{4}</hcclz>
			                    <zs>{5}</zs>
			                    <coclz>{6}</coclz>
			                    <glkqxs>{7}</glkqxs>
			                    <yw>{8}</yw>
			                    <co2clz>{9}</co2clz>
			                    <o2clz>{10}</o2clz>
			                    <hjwd>{11}</hjwd>
			                    <dqyl>{12}</dqyl>
			                    <xdsd>{13}</xdsd>
			                    <sjxl>{14}</sjxl>
			                    <jczt>{15}</jczt>
			                    <gksj>{16}</gksj>
			                    <jcsj>{17}</jcsj>
                                 </vehispara>
			                    </body>
                                </root>",
                                    businessId,
                                    m_mainform.testtimes,
                                    objasmobd.Obdiobd + 1,
                                    cysx,
                                    hcclz,
                                    zs,
                                    coclz,
                                    glkqxs,
                                    yw,
                                    co2clz,
                                    o2clz,
                                    hjwd,
                                    dqyl,
                                    xdsd,
                                    sjxl,
                                    jczt,
                                    gksj,
                                    jcsj);

                string sgc003 = m_vesd.write(vehispara);

                m_mainform.writetext("GC003", vehispara, m_mainform.slicense);
                m_mainform.writetext("GC003返回", m_mainform.decode(sgc003), m_mainform.slicense);

                if (!sgc003.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    message = "上传双怠速过程数据失败 ";
                    return message;
                }

                vehispara = "";
                stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                            m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                            "JC003");

                vehispara = stoubao + string.Format(@"<body><vehispara>
                                <jylsh>{0}</jylsh>
                                <testtimes>{1}</testtimes>
                                <wd>{2}</wd>
                                <dqy>{3}</dqy>
                                <xdsd>{4}</xdsd>
			                    <lambdadown>{5}</lambdadown>
			                    <lambdaup>{6}</lambdaup>
			                    <lambda>{7}</lambda>
			                    <lambdajudge>{8}</lambdajudge>
			                    <lscolimit>{9}</lscolimit>
			                    <lscoresult>{10}</lscoresult>
			                    <lscojudge>{11}</lscojudge>
			                    <lshclimit>{12}</lshclimit>
			                    <lshcresult>{13}</lshcresult>
			                    <lshcjudge>{14}</lshcjudge>
			                    <dszs>{15}</dszs>
                                <ddsjywd>{16}</ddsjywd>
                                <hscolimit>{17}</hscolimit>
                                <hscoresult>{18}</hscoresult>
                                <hscojudge>{19}</hscojudge>
                                <hshcresult>{20}</hshcresult>
                                <hshclimit>{21}</hshclimit>
                                <hshcjudge>{22}</hshcjudge>
                                <gdszs>{23}</gdszs>
                                <gdsjywd>{24}</gdsjywd>
                                <result>{25}</result>
                                 </vehispara>
			                    </body>
                                </root>",
                                    businessId,
                                    m_mainform.testtimes,
                                    objasmsj.fwendu.ToString("0.00"),
                                    objasmsj.fdaqiya.ToString("0.00"),
                                    objasmsj.fshidu.ToString("0.00"),
                                    0.95,
                                    1.05,
                                    objasmsj.fLAMDAG.ToString("0.00"),
                                    objasmsj.lambdajudge,
                                    objasmsj.fCOXZD.ToString("0.0"),
                                    objasmsj.fCOD.ToString("0.00"),
                                    objasmsj.fCOXZD > objasmsj.fCOD ? "1" : "0",
                                    objasmsj.iHCXZD,
                                    objasmsj.iHCD,
                                    objasmsj.iHCXZD > objasmsj.iHCD ? "1" : "0",
                                    objasmsj.dsfdjzs,
                                    objasmsj.ddsjywd,
                                    objasmsj.fCOXZG.ToString("0.0"),
                                    objasmsj.fCOG.ToString("0.00"),
                                    objasmsj.fCOXZG > objasmsj.fCOG ? "1" : "0",
                                    objasmsj.iHCG,
                                    objasmsj.iHCXZG,
                                    objasmsj.iHCXZG > objasmsj.iHCG ? "1" : "0",
                                    objasmsj.gdsfdjzs,
                                    objasmsj.gdsjywd,
                                    objasmsj.bgood ? "1" : "0");


                //检测结果
                string sjc003 = m_vesd.write(vehispara);
                m_mainform.writetext("JC003", vehispara, m_mainform.slicense);
                m_mainform.writetext("JC003返回", m_mainform.decode(sjc003), m_mainform.slicense);

                if (!sjc003.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    message = "上传双怠速结果数据失败 ";
                    return message;
                }
            }
            catch (Exception ex)
            {
                m_mainform.writetext("上传数据失败", ex.ToString(), m_mainform.slicense);
                message = "上传内容出现错误";
                return message;
            }
            return message;
        }

        public override string sjuploadZYJS(string businessId, model.ZYJS.ZYJSsj objsj, model.ZYJS.ZYJSgcsj objgcsj, model.LUG.LUGobdgcsj objobdgcsj)
        {
            string message = "1";
            string cysx = "", ydzds = "", fdjdszs = "", yw = "", sjxl = "", jczt = "", gklx = "1", jcsj = "", gksj = "";
            int icount = 1;                                                                      

            string obdsjxl = "", jqmkd = "", fh = "", obdcs = "", qycgqxh = "", obdglkqxs = "", ymkd = "", fdjzs = "", jql = "",
                  jqyl = "", scgl = "", zyyl = "", hyl = "", no = "", nsbsl = "", pqwd = "", klbjqyc = "", egrkd = "", rypsyl = "";

            for (int i = 0; i <= 41; i++)
            {
                obdsjxl = obdsjxl + objobdgcsj.Obdsjxl[i] + ",";
                jqmkd = jqmkd + objobdgcsj.ObdThrottle[i] + ",";
                fh = fh + objobdgcsj.ObdCLV[i] + ",";
                qycgqxh = qycgqxh + objobdgcsj.ObdPreOxygen[i] + ",";
                obdglkqxs = obdglkqxs + objobdgcsj.ObdExcessAirFactor[i] + ",";
                ymkd = ymkd + objobdgcsj.Obdymkd[i] + ",";
                obdcs = obdcs + objobdgcsj.ObdSpeed[i] + ",";
                fdjzs = fdjzs + objobdgcsj.ObdRPM[i] + ",";
                jql = jql + objobdgcsj.ObdAirInput[i] + ",";
                jqyl = jqyl + objobdgcsj.ObdAirPressure[i] + ",";
                scgl = scgl + objobdgcsj.ObdPower[i] + ",";
                zyyl = zyyl + objobdgcsj.ObdBoostPressure[i] + ",";
                hyl = hyl + objobdgcsj.ObdFuelConsumption[i] + ",";
                no = no + objobdgcsj.ObdNOx[i] + ",";
                nsbsl = nsbsl + objobdgcsj.ObdSCR[i] + ",";
                pqwd = pqwd + objobdgcsj.ObdEGT[i] + ",";
                klbjqyc = klbjqyc + objobdgcsj.ObdDPF[i] + ",";
                egrkd = egrkd + objobdgcsj.ObdEGR[i] + ",";
                rypsyl = rypsyl + objobdgcsj.ObdEFI[i] + ",";
            }
            obdsjxl = obdsjxl.Trim(',');
            sjxl = sjxl.Trim(',');
            jqmkd = jqmkd.Trim(',');
            fh = fh.Trim(',');
            qycgqxh = qycgqxh.Trim(',');
            obdglkqxs = obdglkqxs.Trim(',');
            ymkd = ymkd.Trim(',');
            obdcs = obdcs.Trim(',');
            fdjzs = fdjzs.Trim(',');
            jql = jql.Trim(',');
            jqyl = jqyl.Trim(',');
            scgl = scgl.Trim(',');
            zyyl = zyyl.Trim(',');
            hyl = hyl.Trim(',');
            no = no.Trim(',');
            nsbsl = nsbsl.Trim(',');
            pqwd = pqwd.Trim(',');
            klbjqyc = klbjqyc.Trim(',');
            egrkd = egrkd.Trim(',');
            rypsyl = rypsyl.Trim(',');

            for (int i = 0; i < 4; i++)
            {
                for (int k = 0; k < 13; k++)
                {
                    if (i == 0 && k < 3)
                    {
                        gklx = "1";
                    }
                    else if (i == 1 && k < 3)
                    {
                        gklx = "2";
                    }
                    else if (i == 2 && k < 3)
                    {
                        gklx = "3";
                    }
                    else if (i == 3 && k < 3)
                    {
                        gklx = "4";
                    }
                    if (k > 2)
                    {
                        gklx = "0";
                    }   
                    if (i == 0 && k == 0)
                    {
                        cysx = string.Format(@"{0}", icount);
                        ydzds = string.Format(@"{0}", objgcsj.m_SKGCSJK[i, k]);
                        fdjdszs = string.Format(@"{0}", objgcsj.m_SKGCSJTurn[i, k]);
                        yw = string.Format(@"{0}", objgcsj.m_SKGCSJyw[i, k]);
                        sjxl = string.Format(@"{0}", objgcsj.m_SKGCSJTime[i, k]);
                        jczt = string.Format(@"{0}", gklx);
                        icount++;
                    }
                    else
                    {
                        if (i < 3)
                        {
                            cysx = cysx + "," + string.Format(@"{0}", icount);
                            ydzds = ydzds + "," + string.Format(@"{0}", objgcsj.m_SKGCSJK[i, k]);
                            fdjdszs = fdjdszs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJTurn[i, k]);
                            yw = yw + "," + string.Format(@"{0}", objgcsj.m_SKGCSJyw[i, k]);
                            sjxl = sjxl + "," + string.Format(@"{0}", objgcsj.m_SKGCSJTime[i, k]);
                            jczt = jczt + "," + string.Format(@"{0}", gklx);
                            icount++;
                        }
                        else
                        {
                            if (k < 3)
                            {
                                cysx = cysx + "," + string.Format(@"{0}", icount);
                                ydzds = ydzds + "," + string.Format(@"{0}", objgcsj.m_SKGCSJK[i, k]);
                                fdjdszs = fdjdszs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJTurn[i, k]);
                                yw = yw + "," + string.Format(@"{0}", objgcsj.m_SKGCSJyw[i, k]);
                                sjxl = sjxl + "," + string.Format(@"{0}", objgcsj.m_SKGCSJTime[i, k]);
                                jczt = jczt + "," + string.Format(@"{0}", gklx);
                                icount++;
                            }
                        }
                    }
                }
            }
            jcsj = icount.ToString();
            gksj = "13,13,13,13";

            try
            {
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                              m_mainform.organ,
                                                             m_mainform.jkxlh,
                                                              "GC011");

                vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <testtimes>{1}</testtimes>
                                            <cyds>{2}</cyds>
                                            <cysx>{3}</cysx>
                                            <sjxl>{4}</sjxl>
                                            <jqmkd>{5}</jqmkd>
                                            <fh>{6}</fh>
                                            <qycgqxh>{7}</qycgqxh>
                                            <glkqxs>{8}</glkqxs>
                                            <ymkd>{9}</ymkd>
                                            <cs>{10}</cs>
                                            <fdjzs>{11}</fdjzs>
                                            <jql>{12}</jql>
                                            <jqyl>{13}</jqyl>
                                            <scgl>{14}</scgl>
                                            <zyyl>{15}</zyyl>
                                            <hyl>{16}</hyl>
                                            <no>{17}</no>
                                            <nsbsl>{18}</nsbsl>
                                            <pqwd>{19}</pqwd>
                                            <klbjqyc>{20}</klbjqyc>
                                            <egrkd>{21}</egrkd>
                                            <rypsyl>{22}</rypsyl>
                                            <jczt>{23}</jczt>
                                             </vehispara>
			                                </body>
                                            </root>",
                                                businessId,
                                                m_mainform.testtimes,
                                                "42",
                                                cysx,
                                                obdsjxl,
                                                jqmkd,
                                                fh,
                                                qycgqxh,
                                                obdglkqxs,
                                                ymkd,
                                                obdcs,
                                                fdjzs,
                                                jql,
                                                jqyl,
                                                scgl,
                                                zyyl,
                                                hyl,
                                                no,
                                                nsbsl,
                                                pqwd,
                                                klbjqyc,
                                                egrkd,
                                                rypsyl,
                                                jczt);
                //过程数据

                m_vesd.Url = m_mainform.surl;
                if (mainform.obdzt.Contains("有"))
                {
                    string sgc011 = m_vesd.write(vehispara);
                    m_mainform.writetext("GC011", vehispara, m_mainform.slicense);
                    m_mainform.writetext("GC011返回", m_mainform.decode(sgc011), m_mainform.slicense);
                    if (!sgc011.ToUpper().Contains("<CODE>1</CODE>"))
                    {
                        message = "上传OBD过程数据失败 ";
                        return message;
                    }
                }
                vehispara = "";
                stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                                       m_mainform.organ,
                                                                      m_mainform.jkxlh,
                                                                       "GC005");
                vehispara = stoubao + string.Format(@"<body><vehispara>
                                                <jylsh>{0}</jylsh>
                                                <testtimes>{1}</testtimes>
                                                <cyds>{2}</cyds>
                                                <cysx>{3}</cysx>
                                                <ydzds>{4}</ydzds>
			                                    <fdjdszs>{5}</fdjdszs>
			                                    <yw>{6}</yw>
			                                    <sjxl>{7}</sjxl>
			                                    <jczt>{8}</jczt>
			                                    <jcsj>{9}</jcsj>
			                                    <gksj>{10}</gksj>
                                                 </vehispara>
			                                    </body>
                                                </root>",
                                                    businessId,
                                                    m_mainform.testtimes,
                                                    "42",
                                                    cysx,
                                                    ydzds,
                                                    fdjdszs,
                                                    yw,
                                                    sjxl,
                                                    jczt,
                                                    jcsj,
                                                    gksj);

                string sgc005 = m_vesd.write(vehispara);
                m_mainform.writetext("GC005", vehispara, m_mainform.slicense);
                m_mainform.writetext("GC005返回", m_mainform.decode(sgc005), m_mainform.slicense);

                if (!sgc005.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    message = "上传自由加速过程数据失败 ";
                    return message;
   
                }

                vehispara = "";
                stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                                  m_mainform.organ,
                                                                  m_mainform.jkxlh,
                                                                  "JC005");


                vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <testtimes>{1}</testtimes>
                                            <wd>{2}</wd>
                                            <dqy>{3}</dqy>
                                            <xdsd>{4}</xdsd>
                                            <idlerev>{5}</idlerev>
                                            <enginespeed>{6}</enginespeed>
                                            <smokek4>{7}</smokek4>
                                            <smokek3>{8}</smokek3>
                                            <smokek2>{9}</smokek2>
                                            <smokek1>{10}</smokek1>
                                            <smokeavg>{11}</smokeavg>
                                            <result>{12}</result>
                                            <smokeklimit>{13}</smokeklimit>   
                                            <fdjzs4>{14}</fdjzs4>
                                            <fdjzs3>{15}</fdjzs3>
                                            <fdjzs2>{16}</fdjzs2>
                                            <fdjzs1>{17}</fdjzs1>                                    
                                            </vehispara>
                                            </body>
                                            </root>",
                                                businessId,
                                                m_mainform.testtimes,
                                                objsj.fwendu.ToString("0.00"),
                                                objsj.fdaqiya.ToString("0.00"),
                                                objsj.fshidu.ToString("0.00"),
                                                objsj.idlerev,
                                                objsj.EngRev,
                                                objsj.SK4.ToString("0.00"),//1
                                                objsj.SK1.ToString("0.00"),//2
                                                objsj.SK2.ToString("0.00"),//3
                                                objsj.SK3.ToString("0.00"),//4
                                                objsj.fSKPJ.ToString("0.00"),
                                                objsj.result,
                                                objsj.smokeklimit,                                  
                                                objsj.m_SKTurn4,//1
                                                objsj.m_SKTurn3,//2
                                                objsj.m_SKTurn2,//3
                                                objsj.m_SKTurn);//4;                                               
                //检测结果
                string sjc005 = m_vesd.write(vehispara);
                m_mainform.writetext("JC005", vehispara, m_mainform.slicense);
                m_mainform.writetext("JC005返回", m_mainform.decode(sjc005), m_mainform.slicense);

                if (!sjc005.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    message = "上传自由加速结果数据失败 ";
                    return message;
                }
            }
            catch (Exception ex)
            {
                m_mainform.writetext("上传数据失败", ex.ToString(), m_mainform.slicense);
                message = "上传内容出现错误";
                return message;
            }
            return message;
        }

        public override string sjuploadLUG(string businessId, model.LUG.LUGsj objsj, model.LUG.LUGgcsj objgcsj, model.LUG.LUGobdgcsj objobdgcsj)
        {
            string message = "1";
            string cysx = "", btgclz = "", cs = "", zs = "", jzgl = "", gxsxs = "", zsgl = "", yw = "", glxzxs = "", jsgl = "", btgd = "",
                   dqyl = "", xdsd = "", hjwd = "", sjxl = "", nl = "", jczt = "", noxclz = "", co2clz = "", jcsj = "", gksj = "";

            string obdsjxl = "", jqmkd = "", fh = "", obdcs = "", qycgqxh = "", obdglkqxs = "", ymkd = "", fdjzs = "", jql = "",
                  jqyl = "", scgl = "", zyyl = "", hyl = "", no = "", nsbsl = "", pqwd = "", klbjqyc = "", egrkd = "", rypsyl = "";

            for (int i = 0; i < objgcsj.imaxcount; i++)
            {
                obdsjxl = obdsjxl + objobdgcsj.Obdsjxl[i] + ",";
                jqmkd = jqmkd + objobdgcsj.ObdThrottle[i] + ",";
                fh = fh + objobdgcsj.ObdCLV[i] + ",";
                qycgqxh = qycgqxh + objobdgcsj.ObdPreOxygen[i] + ",";
                obdglkqxs = obdglkqxs + objobdgcsj.ObdExcessAirFactor[i] + ",";
                ymkd = ymkd + objobdgcsj.Obdymkd[i] + ",";
                obdcs = obdcs + objobdgcsj.ObdSpeed[i] + ",";
                fdjzs = fdjzs + objobdgcsj.ObdRPM[i] + ",";
                jql = jql + objobdgcsj.ObdAirInput[i] + ",";
                jqyl = jqyl + objobdgcsj.ObdAirPressure[i] + ",";
                scgl = scgl + objobdgcsj.ObdPower[i] + ",";
                zyyl = zyyl + objobdgcsj.ObdBoostPressure[i] + ",";
                hyl = hyl + objobdgcsj.ObdFuelConsumption[i] + ",";
                no = no + objobdgcsj.ObdNOx[i] + ",";
                nsbsl = nsbsl + objobdgcsj.ObdSCR[i] + ",";
                pqwd = pqwd + objobdgcsj.ObdEGT[i] + ",";
                klbjqyc = klbjqyc + objobdgcsj.ObdDPF[i] + ",";
                egrkd = egrkd + objobdgcsj.ObdEGR[i] + ",";
                rypsyl = rypsyl + objobdgcsj.ObdEFI[i] + ",";
            }
            obdsjxl = obdsjxl.Trim(',');
            sjxl = sjxl.Trim(',');
            jqmkd = jqmkd.Trim(',');
            fh = fh.Trim(',');
            qycgqxh = qycgqxh.Trim(',');
            obdglkqxs = obdglkqxs.Trim(',');
            ymkd = ymkd.Trim(',');
            obdcs = obdcs.Trim(',');
            fdjzs = fdjzs.Trim(',');
            jql = jql.Trim(',');
            jqyl = jqyl.Trim(',');
            scgl = scgl.Trim(',');
            zyyl = zyyl.Trim(',');
            hyl = hyl.Trim(',');
            no = no.Trim(',');
            nsbsl = nsbsl.Trim(',');
            pqwd = pqwd.Trim(',');
            klbjqyc = klbjqyc.Trim(',');
            egrkd = egrkd.Trim(',');
            rypsyl = rypsyl.Trim(',');


            jcsj = objgcsj.jcsj;
            gksj = objgcsj.gcsj;
            for (int i = 0; i < objgcsj.imaxcount; i++)
            {
                if (i == 0)
                {

                    cysx = string.Format(@"{0}", i + 1);
                    btgclz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    noxclz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxNO[i]);
                    cs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxSpeed[i]);
                    zs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxTurn[i]);
                    jzgl = string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxPower[i]));
                    gxsxs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    zsgl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxPower[i]);
                    yw = string.Format(@"{0}", objgcsj.m_SKGCSJmaxyouwen[i]);
                    glxzxs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxPowerK[i].ToString("0.0"));
                    jsgl = string.Format(@"{0}", 0.5);
                    btgd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    dqyl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxdaqiya[i]);
                    xdsd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxshidu[i]);
                    hjwd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxwendu[i]);
                    sjxl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxTime[i]);
                    nl = string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxForce[i]));
                    jczt = string.Format(@"{0}", objgcsj.m_SKGCSJmaxjczt[i]);
                    co2clz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxco2[i]);
                }
                else
                {
                    cysx = cysx + "," + string.Format(@"{0}", i + 1);
                    btgclz = btgclz + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    noxclz = noxclz + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxNO[i]);
                    cs = cs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxSpeed[i]);
                    zs = zs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxTurn[i]);
                    jzgl = jzgl + "," + string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxPower[i]));
                    gxsxs = gxsxs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    zsgl = zsgl + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxPower[i]);
                    yw = yw + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxyouwen[i]);
                    glxzxs = glxzxs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxPowerK[i].ToString("0.0"));
                    jsgl = jsgl + "," + string.Format(@"{0}", 0.5);
                    btgd = btgd + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxdaqiya[i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxshidu[i]);
                    hjwd = hjwd + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxwendu[i]);
                    sjxl = sjxl + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxTime[i]);
                    nl = nl + "," + string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxForce[i]));
                    jczt = jczt + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxjczt[i]);

                    co2clz = co2clz + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxco2[i]);
                }
            }
            try
            {
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                               m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                               "GC011");

                vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                <testtimes>{1}</testtimes>
                                <cyds>{2}</cyds>
                                <cysx>{3}</cysx>
                                <sjxl>{4}</sjxl>
                                <jqmkd>{5}</jqmkd>
                                <fh>{6}</fh>
                                <qycgqxh>{7}</qycgqxh>
                                <glkqxs>{8}</glkqxs>
                                <ymkd>{9}</ymkd>
                                <cs>{10}</cs>
                                <fdjzs>{11}</fdjzs>
                                <jql>{12}</jql>
                                <jqyl>{13}</jqyl>
                                <scgl>{14}</scgl>
                                <zyyl>{15}</zyyl>
                                <hyl>{16}</hyl>
                                <no>{17}</no>
                                <nsbsl>{18}</nsbsl>
                                <pqwd>{19}</pqwd>
                                <klbjqyc>{20}</klbjqyc>
                                <egrkd>{21}</egrkd>
                                <rypsyl>{22}</rypsyl>
                                <jczt>{23}</jczt>
                                 </vehispara>
			                    </body>
                                </root>",
                                    businessId,
                                    m_mainform.testtimes,
                                    objgcsj.imaxcount,
                                    cysx,
                                    obdsjxl,
                                    jqmkd,
                                    fh,
                                    qycgqxh,
                                    obdglkqxs,
                                    ymkd,
                                    obdcs,
                                    fdjzs,
                                    jql,
                                    jqyl,
                                    scgl,
                                    zyyl,
                                    hyl,
                                    no,
                                    nsbsl,
                                    pqwd,
                                    klbjqyc,
                                    egrkd,
                                    rypsyl,
                                    jczt);
                //过程数据

                m_vesd.Url = m_mainform.surl;
                if (mainform.obdzt.Contains("有"))
                {
                    string sgc011 = m_vesd.write(vehispara);
                    m_mainform.writetext("GC011", vehispara, m_mainform.slicense);
                    m_mainform.writetext("GC011返回", m_mainform.decode(sgc011), m_mainform.slicense);
                    if (!sgc011.ToUpper().Contains("<CODE>1</CODE>"))
                    {
                        message = "上传OBD过程数据失败 ";
                        return message;
                    }
                }
                vehispara = "";
                stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                                   m_mainform.organ,
                                                                   m_mainform.jkxlh,
                                                                   "GC004");

                vehispara = stoubao + string.Format(@"<body><vehispara>
                                           <jylsh>{0}</jylsh>
                                <testtimes>{1}</testtimes>
                                <cyds>{2}</cyds>
                                <cysx>{3}</cysx>
                                <cs>{4}</cs>
			                    <zs>{5}</zs>
			                    <jzgl>{6}</jzgl>
			                    <gxsxs>{7}</gxsxs>
			                    <zsgl>{8}</zsgl>
			                    <yw>{9}</yw>
			                    <glxzxs>{10}</glxzxs>
			                    <jsgl>{11}</jsgl>
			                    <btgd>{12}</btgd>
			                    <dqyl>{13}</dqyl>
			                    <xdsd>{14}</xdsd>
			                    <hjwd>{15}</hjwd>
                                <sjxl>{16}</sjxl>
                                <nl>{17}</nl>
                                <jczt>{18}</jczt>
                                <btgclz>{19}</btgclz>
                                <noxclz>{20}</noxclz>
                                <co2clz>{21}</co2clz>
                                <jcsj>{22}</jcsj>
                                <gksj>{23}</gksj>
                                </vehispara>
                                </body>
                                </root>",
                                    businessId,
                                    m_mainform.testtimes,
                                    objgcsj.imaxcount,
                                    cysx,
                                    cs,
                                    zs,
                                    jzgl,
                                    gxsxs,
                                    zsgl,
                                    yw,
                                    glxzxs,
                                    jsgl,
                                    btgd,
                                    dqyl,
                                    xdsd,
                                    hjwd,
                                    sjxl,
                                    nl,
                                    jczt,
                                    btgclz,
                                    noxclz,
                                    co2clz,
                                    jcsj,
                                    gksj);

                string sgc004 = m_vesd.write(vehispara);
                m_mainform.writetext("GC004", vehispara, m_mainform.slicense);
                m_mainform.writetext("GC004返回", m_mainform.decode(sgc004), m_mainform.slicense);

                if (!sgc004.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    message = "上传LUG过程数据失败 ";
                    return message;
                }

                vehispara = "";
                stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                             m_mainform.organ,
                                                             m_mainform.jkxlh,
                                                             "JC004");

                vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <testtimes>{1}</testtimes>
                                            <wd>{2}</wd>
                                            <dqy>{3}</dqy>
                                            <xdsd>{4}</xdsd>
			                                <velmaxhp>{5}</velmaxhp>
			                                <rev100>{6}</rev100>
			                                <maxpower>{7}</maxpower>
			                                <maxpowerlimit>{8}</maxpowerlimit>
			                                <zdlbglzs>{9}</zdlbglzs>
			                                <zdlbgljudge>{10}</zdlbgljudge>
			                                <smokeklimit>{11}</smokeklimit>
			                                <ydjudge>{12}</ydjudge>
			                                <k100>{13}</k100>
			                                <k80>{14}</k80>
                                            <nox>{15}</nox>
                                            <noxlimit>{16}</noxlimit>
                                            <raterevup>{17}</raterevup>
                                            <raterevdown>{18}</raterevdown>
                                            <result>{19}</result>
                                                </vehispara>
			                                </body>
                                            </root>",
                                                businessId,
                                                m_mainform.testtimes,
                                                objsj.fwendu.ToString("0.00"),
                                                objsj.fdaqiya.ToString("0.00"),
                                                objsj.fshidu.ToString("0.00"),
                                                objsj.zdlbglsjxsd.ToString("0.00"),
                                                objsj.zdlbglfdjzs.ToString("0"),
                                                objsj.fFindMaxPower.ToString("0.0"),
                                                (objsj.fiedgl * 0.4).ToString(),
                                                objsj.zdlbglfdjzs.ToString("0"),
                                                objsj.fFindMaxPower > (objsj.fiedgl * 0.4) ? "1" : "0",
                                                m_mainform.TypeApprovalLimits.ToString("0.00"),
                                                (objsj.m_sk100 > m_mainform.TypeApprovalLimits || objsj.m_sk80 > m_mainform.TypeApprovalLimits) ? "0" : "1",
                                                objsj.m_sk100.ToString("0.00"),
                                                objsj.m_sk80.ToString("0.00"),
                                                objsj.m_sno80,
                                                m_mainform.noxlimit.ToString("0.00"),
                                                objsj.raterevup.ToString("0"),
                                                objsj.raterevdown.ToString("0"),
                                                objsj.bgood ? "1" : "0");
                //检测结果
                string sjc004 = m_vesd.write(vehispara);
                m_mainform.writetext("JC004", vehispara, m_mainform.slicense);
                m_mainform.writetext("JC004返回", m_mainform.decode(sjc004), m_mainform.slicense);

                if (!sjc004.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    message = "上传LUG结果数据失败 ";
                    return message;
                }
            }
            catch (Exception ex)
            {
                m_mainform.writetext("上传数据失败", ex.ToString(), m_mainform.slicense);
                message = "上传内容出现错误";
                return message;
            }
            return message;
        }

        public override string uploadhxjc(model.尾气自检.hxjc objhxjc)//汽油加载滑行(ZJ001)
        {
            string sdqj1 = "50-30";
            string sdqj2 = "35-15";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                              m_mainform.organ,
                                                             m_mainform.jkxlh,
                                                              "ZJ000");
         
                vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <zjlx>{2}</zjlx>
                                <cgjlx>{3}</cgjlx>
                                <sdqj1>{4}</sdqj1>
			                    <sdqj2>{5}</sdqj2>
			                    <jcrq>{6}</jcrq>
			                    <jckssj>{7}</jckssj>
                                <sjhxsj1>{8}</sjhxsj1>
			                    <sjhxsj2>{9}</sjhxsj2>
                                <ns1>{10}</ns1>
                                <ns2>{11}</ns2>
                                <myhxsj1>{12}</myhxsj1>
                                <myhxsj2>{13}</myhxsj2>
			                    <zsgl1>{14}</zsgl1>
                                <zsgl2>{15}</zsgl2>
                                <jbgl>{16}</jbgl>
                                <jcjg1>{17}</jcjg1>
                                <jcjg2>{18}</jcjg2>
                                <jcjg>{19}</jcjg>
                                <jcry>{20}</jcry>
                                </vehispara>
			                    </body>
                                </root>",
                             m_mainform.stationCode,
                             m_mainform.lineCode,
                             "01",
                             "1",
                             sdqj1,
                             sdqj2,
                             DateTime.Parse(objhxjc.dtBeginTime).ToString("yyyy-MM-dd"),
                             objhxjc.dtBeginTime,
                             float.Parse(objhxjc.ActualTime25).ToString("0.000"),
                             float.Parse(objhxjc.ActualTime40).ToString("0.000"),
                             float.Parse(objhxjc.fLossPW25).ToString("0.00"),
                             float.Parse(objhxjc.fLossPW40).ToString("0.00"),
                             float.Parse(objhxjc.TheoretialTime25).ToString("0.000"),
                             float.Parse(objhxjc.TheoretialTime40).ToString("0.000"),
                             objhxjc.fPowerI.Length < 1 ? "1" : float.Parse(objhxjc.fPowerI).ToString("0.00"),
                             objhxjc.fPowerI.Length < 1 ? "1" : float.Parse(objhxjc.fPowerI).ToString("0.00"),
                             float.Parse(objhxjc.fDIW).ToString("0.00"),
                             objhxjc.JudgeResult25,
                             objhxjc.JudgeResult40,
                             "1",
                             objhxjc.Checker);
            
          
            m_vesd.Url = m_mainform.surl;
            string sgc005 = m_vesd.write(vehispara);
            m_mainform.writetext("汽油滑行", vehispara, m_mainform.slicense);
            m_mainform.writetext("汽油滑行" + "返回", m_mainform.decode(sgc005), m_mainform.slicense);

            return m_mainform.decode(sgc005);
        }

        public override string uploadzj(model.尾气自检.fjgl objfjgl)//汽油附加功率(ZJ002)
        {
            string sdqj1 = "50-30";
            string sdqj2 = "35-15";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                              m_mainform.organ,
                                                             m_mainform.jkxlh,
                                                              "ZJ000");

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <zjlx>{2}</zjlx>
                                <cgjlx>{3}</cgjlx>
                                <sdqj1>{4}</sdqj1>
			                    <sdqj2>{5}</sdqj2>
			                    <jcrq>{6}</jcrq>
			                    <jckssj>{7}</jckssj>
                                <jcjssj>{8}</jcjssj>
                                <sjhxsj1>{9}</sjhxsj1>
			                    <sjhxsj2>{10}</sjhxsj2>
                                <nsl1>{11}</nsl1>
                                <nsl2>{12}</nsl2>
                                <jbgl>{13}</jbgl>
                                <jcjg>{14}</jcjg>
                                <jcry>{15}</jcry>
                                </vehispara>
			                    </body>
                                </root>",
                 m_mainform.stationCode,
                 m_mainform.lineCode,
                 "02",
                 "1",
                 sdqj1,
                 sdqj2,
                 objfjgl.CheckDate,
                 objfjgl.PLTimeStart,
                 objfjgl.SlideTimeEnd,
                 float.Parse(objfjgl.ACDT25).ToString("0.000"),
                 float.Parse(objfjgl.ACDT40).ToString("0.000"),
                 float.Parse(objfjgl.PLHP25).ToString("0.00"),
                 float.Parse(objfjgl.PLHP40).ToString("0.00"),
                 float.Parse(objfjgl.DIW).ToString("0.00"),
                 "1",
                 objfjgl.Checker);

            m_vesd.Url = m_mainform.surl;
            string sgc005 = m_vesd.write(vehispara);
            m_mainform.writetext("汽油附加功率", vehispara, m_mainform.slicense);
            m_mainform.writetext("汽油附加功率" + "返回", m_mainform.decode(sgc005), m_mainform.slicense);

            return m_mainform.decode(sgc005);
        }

        public override string uploadzj(string tph,model.尾气自检.cyhxsj objxljc)//柴油加载滑行(ZJ001)
        {
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                              m_mainform.organ,
                                                             m_mainform.jkxlh,
                                                              "ZJ000");

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <zjlx>{2}</zjlx>
                                <cgjlx>{3}</cgjlx>
                                <sdqj1>{4}</sdqj1>
			                    <sdqj2>{5}</sdqj2>
			                    <jcrq>{6}</jcrq>
			                    <jckssj>{7}</jckssj>
                                <sjhxsj1>{8}</sjhxsj1>
			                    <sjhxsj2>{9}</sjhxsj2>
                                <ns1>{10}</ns1>
                                <ns2>{11}</ns2>
                                <myhxsj1>{12}</myhxsj1>
                                <myhxsj2>{13}</myhxsj2>
			                    <zsgl1>{14}</zsgl1>
                                <zsgl2>{15}</zsgl2>
                                <jbgl>{16}</jbgl>
                                <jcjg1>{17}</jcjg1>
                                <jcjg2>{18}</jcjg2>
                                <jcjg>{19}</jcjg>
                                <jcry>{20}</jcry>
                                </vehispara>
			                    </body>
                                </root>",
                         m_mainform.stationCode,
                         m_mainform.lineCode,
                         "01",
                         "2",
                         "80-60",
                         "60-40",
                         DateTime.Parse(objxljc.SlideTimeStart).ToString("yyyy-MM-dd"),
                         objxljc.SlideTimeStart,
                         tph.Contains("10") ? float.Parse(objxljc.IHP10ACDT70).ToString("0.000") : tph.Contains("20") ? float.Parse(objxljc.IHP20ACDT70).ToString("0.000") : float.Parse(objxljc.IHP30ACDT70).ToString("0.000"),
                         tph.Contains("10") ? float.Parse(objxljc.IHP10ACDT50).ToString("0.000") : tph.Contains("20") ? float.Parse(objxljc.IHP20ACDT50).ToString("0.000") : float.Parse(objxljc.IHP30ACDT50).ToString("0.000"),
                         float.Parse(objxljc.PLHP70).ToString("0.00"),
                         float.Parse(objxljc.PLHP50).ToString("0.00"),
                         tph.Contains("10") ? float.Parse(objxljc.IHP10ACDT70).ToString("0.000") : tph.Contains("20") ? float.Parse(objxljc.IHP20ACDT70).ToString("0.000") : float.Parse(objxljc.IHP30ACDT70).ToString("0.000"),
                         tph.Contains("10") ? float.Parse(objxljc.IHP10ACDT50).ToString("0.000") : tph.Contains("20") ? float.Parse(objxljc.IHP20ACDT50).ToString("0.000") : float.Parse(objxljc.IHP30ACDT50).ToString("0.000"),
                         float.Parse(tph).ToString("0.00"),
                         float.Parse(tph).ToString("0.00"),
                         float.Parse(objxljc.DIW).ToString("0.00"),
                         objxljc.SlideCheckJudge100,
                         objxljc.SlideCheckJudge80,
                         "1",
                         objxljc.Checker);



            WebReferenceCS.VeptsOutAccess m_vesd = new WebReferenceCS.VeptsOutAccess();
            m_vesd.Url = m_mainform.surl;
            string sgc005 = m_vesd.write(vehispara);

            m_mainform.writetext("柴油滑行", vehispara, m_mainform.slicense);
            m_mainform.writetext("柴油滑行" + "返回", m_mainform.decode(sgc005), m_mainform.slicense);

            return m_mainform.decode(sgc005);
        }

        public override string uploadzj(model.尾气自检.cyfjgl objxljc)//柴油附加功率(ZJ002)
        {
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                              m_mainform.organ,
                                                             m_mainform.jkxlh,
                                                              "ZJ000");

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <zjlx>{2}</zjlx>
                                <cgjlx>{3}</cgjlx>
                                <sdqj1>{4}</sdqj1>
			                    <sdqj2>{5}</sdqj2>
			                    <jcrq>{6}</jcrq>
			                    <jckssj>{7}</jckssj>
                                <jcjssj>{8}</jcjssj>
                                <sjhxsj1>{9}</sjhxsj1>
			                    <sjhxsj2>{10}</sjhxsj2>
                                <nsl1>{11}</nsl1>
                                <nsl2>{12}</nsl2>
                                <jbgl>{13}</jbgl>
                                <jcjg>{14}</jcjg>
                                <jcry>{15}</jcry>
                                </vehispara>
			                    </body>
                                </root>",
                 m_mainform.stationCode,
                 m_mainform.lineCode,
                 "02",
                 "1",
                 "80-60",
                 "60-40",
                 objxljc.CheckDate,
                 objxljc.PLTimeStart,
                 objxljc.SlideTimeEnd,
                 float.Parse(objxljc.ACDT70).ToString("0.000"),
                 float.Parse(objxljc.ACDT50).ToString("0.000"),
                 float.Parse(objxljc.PLHP70).ToString("0.00"),
                 float.Parse(objxljc.PLHP50).ToString("0.00"),
                 float.Parse(objxljc.DIW).ToString("0.00"),
                 "1",
                 objxljc.Checker);

            m_vesd.Url = m_mainform.surl;
            string sgc005 = m_vesd.write(vehispara);
            m_mainform.writetext("柴油附加功率", vehispara, m_mainform.slicense);
            m_mainform.writetext("柴油附加功率" + "返回", m_mainform.decode(sgc005), m_mainform.slicense);

            return m_mainform.decode(sgc005);
        }

        public override string uploadzj(model.尾气自检.fqyddjc objxljc)//分析仪检查(ZJ000)//底标气检查 (ZJ000) //(BD000)
        {
            var zjlx = "03";
            string str = "";
            string sgc005 = "";
            //if (objxljc.Checkkind.Contains("2"))//检定          
            //{
                if (objxljc.CheckTypeex.Contains("中低浓度"))
                {
                    str = "2";
                }
                else if (objxljc.CheckTypeex.Contains("低浓度"))
                {
                    str = "1";
                    zjlx = "06";
                }
                else if (objxljc.CheckTypeex.Contains("中高浓度"))
                {
                    str = "3";
                }
                else if (objxljc.CheckTypeex.Contains("高浓度"))
                {
                    str = "4";
                }
                else if (objxljc.CheckTypeex.Contains("零度"))
                {
                    str = "5";
                }
                else
                {
                    str = "1";
                }
            if(!str.Contains("4"))
            {
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                                        m_mainform.organ,
                                                                        m_mainform.jkxlh,
                                                                        "ZJ000");
                vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <zjlx>{3}</zjlx>
                                <jcrq>{4}</jcrq>
                                <jclx>{5}</jclx>
			                    <jckssj>{6}</jckssj>
                                <c3h8nd>{7}</c3h8nd>
                                <cond>{8}</cond>
			                    <co2nd>{9}</co2nd>			                    
			                    <nond>{10}</nond>
			                    <o2nd>{11}</o2nd>
                                <hcjcz>{12}</hcjcz>
                                <cojcz>{13}</cojcz>
                                <co2jcz>{14}</co2jcz>
                                <nojcz>{15}</nojcz>
                                <o2jcz>{16}</o2jcz>		                    			                    			                    			                    		                   
			                    <pef>{17}</pef>
			                    <jcjg>{18}</jcjg>
			                    <jcry>{19}</jcry>
                                 </vehispara>
			                    </body>
                                </root>",
                             m_mainform.stationCode,
                             m_mainform.lineCode,
                             mainform.registCode,
                             zjlx,
                             DateTime.Parse(objxljc.dtCheckDate).ToString("yyyy-MM-dd"),
                             str,
                             objxljc.dtBeginTime,
                             float.Parse(objxljc.C3H8).ToString("0.00"),
                             float.Parse(objxljc.StdValCO).ToString("0.00"),
                             float.Parse(objxljc.StdValCO2).ToString("0.00"),
                             float.Parse(objxljc.StdValNO).ToString("0.00"),
                             float.Parse(objxljc.StdValO2).ToString("0.00"),
                             float.Parse(objxljc.CheckValHC).ToString("0.00"),
                             float.Parse(objxljc.CheckValCO).ToString("0.00"),
                             float.Parse(objxljc.CheckValCO2).ToString("0.00"),
                             float.Parse(objxljc.CheckValNO).ToString("0.00"),
                             float.Parse(objxljc.CheckValO2).ToString("0.00"),
                             float.Parse(objxljc.PEF).ToString("0.000"),
                             "1",
                             m_mainform.sczyxx.Length < 1 ? m_mainform.InspectionOperator : m_mainform.sczyxx);

                m_vesd.Url = m_mainform.surl;
                sgc005 = m_vesd.write(vehispara);
                m_mainform.writetext("ZJ000" + zjlx, vehispara, m_mainform.slicense);
                m_mainform.writetext("ZJ000" + zjlx + "返回", m_mainform.decode(sgc005), m_mainform.slicense);

                if (zjlx.Contains("06"))//气体为底标时，也上传 ZJ000_03
                {
                    zjlx = "03";
                    stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                    stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                                       m_mainform.organ,
                                                                       m_mainform.jkxlh,
                                                                       "ZJ000");
                    vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>                        
                                <zjlx>{3}</zjlx>
                                <jcrq>{4}</jcrq>
                                <jclx>{5}</jclx>
			                    <jckssj>{6}</jckssj>
                                <c3h8nd>{7}</c3h8nd>
                                <cond>{8}</cond>
			                    <co2nd>{9}</co2nd>			                    
			                    <nond>{10}</nond>
			                    <o2nd>{11}</o2nd>
                                <hcjcz>{12}</hcjcz>
                                <cojcz>{13}</cojcz>
                                <co2jcz>{14}</co2jcz>
                                <nojcz>{15}</nojcz>
                                <o2jcz>{16}</o2jcz>		                    			                    			                    			                    		                   
			                    <pef>{17}</pef>
			                    <jcjg>{18}</jcjg>
			                    <jcry>{19}</jcry>
                                 </vehispara>
			                    </body>
                                </root>",
                                 m_mainform.stationCode,
                                 m_mainform.lineCode,
                                 mainform.registCode,
                                 zjlx,
                                 DateTime.Parse(objxljc.dtCheckDate).ToString("yyyy-MM-dd"),
                                 1,
                                 objxljc.dtBeginTime,
                                 float.Parse(objxljc.C3H8).ToString("0.00"),
                                 float.Parse(objxljc.StdValCO).ToString("0.00"),
                                 float.Parse(objxljc.StdValCO2).ToString("0.00"),
                                 float.Parse(objxljc.StdValNO).ToString("0.00"),
                                 float.Parse(objxljc.StdValO2).ToString("0.00"),
                                 float.Parse(objxljc.CheckValHC).ToString("0.00"),
                                 float.Parse(objxljc.CheckValCO).ToString("0.00"),
                                 float.Parse(objxljc.CheckValCO2).ToString("0.00"),
                                 float.Parse(objxljc.CheckValNO).ToString("0.00"),
                                 float.Parse(objxljc.CheckValO2).ToString("0.00"),
                                 float.Parse(objxljc.PEF).ToString("0.000"),
                                 "1",
                                 m_mainform.sczyxx.Length < 1 ? m_mainform.InspectionOperator : m_mainform.sczyxx);

                    sgc005 = m_vesd.write(vehispara);
                    m_mainform.writetext("ZJ000" + zjlx, vehispara, m_mainform.slicense);
                    m_mainform.writetext("ZJ000" + zjlx + "返回", m_mainform.decode(sgc005), m_mainform.slicense);
                }
            }
            else
            {
                string bdnr = string.Format(@"
             <lx>1</lx>                
            <bzc3h8>{0}</bzc3h8>      
            <kssj>{1}</kssj>
            <jssj>{2}</jssj>
            <sdzhc1>{3}</sdzhc1>                 
            <sczhc1>{4}</sczhc1>                
            <jdwczhc1>{5}</jdwczhc1>               
            <xdwczhc1>{6}</xdwczhc1>           
            <sdzhc2>{7}</sdzhc2>                
            <sczhc2>{8}</sczhc2>                
            <jdwczhc2>{9}</jdwczhc2>               
            <xdwczhc2>{10}</xdwczhc2>            
            <sdzco1>{11}</sdzco1>               
            <sczco1>{12}</sczco1>                
            <jdwczco1>{13}</jdwczco1>            
            <xdwczco1>{14}</xdwczco1>            
            <sdzco2>{15}</sdzco2>                 
            <sczco2>{16}</sczco2>                
            <jdwczco2>{17}</jdwczco2>            
            <xdwczco2>{18}</xdwczco2>            
            <sdzco21>{19}</sdzco21>              
            <sczco21>{20}</sczco21>              
            <jdwczco21>{21}</jdwczco21>          
            <xdwczco21>{22}</xdwczco21>          
            <sdzco22>{23}</sdzco22>             
            <sczco22>{24}</sczco22>             
            <jdwczco22>{25}</jdwczco22>          
            <xdwczco22>{26}</xdwczco22>         
            <sdzno1>{27}</sdzno1>                 
            <sczno1>{28}</sczno1>                 
            <jdwczno1>{29}</jdwczno1>            
            <xdwczno1>{30}</xdwczno1>            
            <sdzno2>{31}</sdzno2>                
            <sczno2>{32}</sczno2>                
            <jdwczno2>{33}</jdwczno2>           
            <xdwczno2>{34}</xdwczno2>           
            <pef>{35}</pef>                          
            <jcjg>{36}</jcjg>",
           objxljc.C3H8,
           DateTime.Now.AddMinutes(-5),
           DateTime.Now,
           objxljc.StdValHC,
           objxljc.CheckValHC,
           objxljc.DivValHC,
           objxljc.RateValHC,
           objxljc.StdValHC,
           objxljc.CheckValHC,
           objxljc.DivValHC,
           objxljc.RateValHC,
           objxljc.StdValCO,
           objxljc.CheckValCO,
           objxljc.DivValCO,
           objxljc.RateValCO,
           objxljc.StdValCO,
           objxljc.CheckValCO,
           objxljc.DivValCO,
           objxljc.RateValCO,
           objxljc.StdValCO2,
           objxljc.CheckValCO2,
           objxljc.DivValCO2,
           objxljc.RateValCO2,
           objxljc.StdValCO2,
           objxljc.CheckValCO2,
           objxljc.DivValCO2,
           objxljc.RateValCO2,
           objxljc.StdValNO,
           objxljc.CheckValNO,
           objxljc.DivValNO,
           objxljc.RateValNO,
           objxljc.StdValNO,
           objxljc.CheckValNO,
           objxljc.DivValNO,
           objxljc.RateValNO,
           objxljc.PEF,
           "1");
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                                      m_mainform.organ,
                                                                     m_mainform.jkxlh,
                                                                      "BD000");
                vehispara = stoubao + string.Format(@"<body><vehispara>
                                <sbbh>{0}</sbbh>
                                <bdsj>{1}</bdsj>
                                <bdr>{2}</bdr>
                                <czr>{3}</czr>
                                <bdlx>{4}</bdlx>
			                    <bdnr>{5}</bdnr>
			                    <bdjg>{6}</bdjg>
			                    <tsno>{7}</tsno>
			                    <testlineno>{8}</testlineno>
                                 </vehispara>
			                    </body>
                                </root>",
                                m_mainform.sdpcgjsbbh,
                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:dd"),
                                m_mainform.sczyxx.Length < 1 ? m_mainform.InspectionOperator : m_mainform.sczyxx,
                                m_mainform.sczyxx.Length < 1 ? m_mainform.InspectionOperator : m_mainform.sczyxx,
                                "05",
                                bdnr,
                                "1",
                                m_mainform.stationCode,
                                m_mainform.lineCode);

                m_vesd.Url = m_mainform.surl;
                sgc005 = m_vesd.write(vehispara);
                m_mainform.writetext("BD000_05", vehispara, m_mainform.slicense);
                m_mainform.writetext("BD000_05返回", m_mainform.decode(sgc005), m_mainform.slicense);

            }

            return m_mainform.decode(sgc005);
        }

        public override string uploadzj(model.尾气自检.xljc objxljc)//泄漏
        {
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                               m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                               "ZJ000");

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <zjlx>{2}</zjlx>
                                <jcrq>{3}</jcrq>
                                <jckssj>{4}</jckssj>
			                    <jcjg>{5}</jcjg>                   
                                 </vehispara>
			                    </body>
                                </root>",
                         m_mainform.stationCode,
                         m_mainform.lineCode,
                         "04",
                         DateTime.Parse(objxljc.dtCheckDate).ToString("yyyy-MM-dd"),
                         objxljc.dtBeginTime,
                         objxljc.nJudegeResult);

            m_vesd.Url = m_mainform.surl;
            string sgc005 = m_vesd.write(vehispara);
            m_mainform.writetext("泄露", vehispara, m_mainform.slicense);
            m_mainform.writetext("泄露返回", m_mainform.decode(sgc005), m_mainform.slicense);

            return m_mainform.decode(sgc005);
        }

        public override string uploadzj(model.尾气自检.yliangcheng objxljc)//氧量程
        {
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                                m_mainform.organ,
                                                                m_mainform.jkxlh,
                                                                "ZJ000");

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <zjlx>{2}</zjlx>
                                <jcrq>{3}</jcrq>
                                <jckssj>{4}</jckssj>
			                    <o2lcbz>{5}</o2lcbz>
			                    <o2lcclz>{6}</o2lcclz>
			                    <o2lcwc>{7}</o2lcwc>
			                    <jcjg>{8}</jcjg>	
                                <jcry>{9}</jcry>	                  
                                 </vehispara>
			                    </body>
                                </root>",
                         m_mainform.stationCode,
                         m_mainform.lineCode,
                         "05",
                         DateTime.Parse(objxljc.dtCheckDate).ToString("yyyy-MM-dd"),
                         objxljc.dtBeginTime,
                         float.Parse(objxljc.StdVal).ToString("0.00"),
                         float.Parse(objxljc.CheckVal).ToString("0.00"),
                         float.Parse(objxljc.DivVal).ToString("0.00"),
                         objxljc.nJudgeResult.Contains("合格") ? "1" : "0",
                         m_mainform.sczyxx.Length < 1 ? m_mainform.InspectionOperator : m_mainform.sczyxx);

            m_vesd.Url = m_mainform.surl;
            string sgc005 = m_vesd.write(vehispara);
            m_mainform.writetext("氧量程", vehispara, m_mainform.slicense);
            m_mainform.writetext("氧量程返回", m_mainform.decode(sgc005), m_mainform.slicense);

            return m_mainform.decode(sgc005);
        }

        public override string uploadzj(model.尾气自检.dzqxzzijian objxljc)//电子环境信息检查
        {

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                                m_mainform.organ,
                                                                m_mainform.jkxlh,
                                                                "ZJ000");

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <zjlx>{2}</zjlx>
                                <jcrq>{3}</jcrq>
                                <jckssj>{4}</jckssj>
			                    <jcjssj>{5}</jcjssj>
			                    <txjc>{6}</txjc>
			                    <hjwd>{7}</hjwd>
			                    <yqwd>{8}</yqwd>
			                    <hjsd>{9}</hjsd>
			                    <yqsd>{10}</yqsd>
			                    <hjqy>{11}</hjqy>
			                    <yqqy>{12}</yqqy>
			                    <jcjg>{13}</jcjg>
                                <jcry>{14}</jcry>
                                </vehispara>
			                    </body>
                                </root>",
                        m_mainform.stationCode,
                        m_mainform.lineCode,
                        "09",
                        DateTime.Parse(objxljc.dtCheckDate).ToString("yyyy-MM-dd"),
                        objxljc.dtBeginTime,
                        objxljc.dtEndTime,
                        "1",
                        float.Parse(objxljc.CheckTempVal).ToString("0.00"),//环境
                        float.Parse(objxljc.StdTempVal).ToString("0.00"),
                        float.Parse(objxljc.CheckPressVal).ToString("0.00"),//环境
                        float.Parse(objxljc.StdHumiVal).ToString("0.00"),
                        float.Parse(objxljc.CheckHumiVal).ToString("0.00"),//环境
                        float.Parse(objxljc.StdPressVal).ToString("0.00"),
                        objxljc.nJudegeResult,
                        objxljc.jcry.Length < 1 ? m_mainform.InspectionOperator : objxljc.jcry);

            m_vesd.Url = m_mainform.surl;
            string sgc005 = m_vesd.write(vehispara);
            m_mainform.writetext("环境温湿度", vehispara, m_mainform.slicense);
            m_mainform.writetext("环境温湿度返回", m_mainform.decode(sgc005), m_mainform.slicense);

            return m_mainform.decode(sgc005);
        }

        public override string uploadzj(model.尾气自检.btgnoxyqjd objxljc)//氮氧化物分析仪检查
        {
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                                m_mainform.organ,
                                                                m_mainform.jkxlh,
                                                                "ZJ000");

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <zjlx>{2}</zjlx>
                                <jcrq>{3}</jcrq>
                                <jckssj>{4}</jckssj>
                                <jcjssj>{5}</jcjssj>
                                <co2nd>{6}</co2nd>
                                <nond>{7}</nond>
                                <no2nd>{8}</no2nd>
                                <co2jcz>{9}</co2jcz>
                                <nojcz>{10}</nojcz>
                                <no2jcz>{11}</no2jcz>
                                <jcjg>{12}</jcjg>
			                    <jcry>{13}</jcry>		                   
                                 </vehispara>
			                    </body>
                                </root>",
                                 m_mainform.stationCode,
                                 m_mainform.lineCode,
                                 "10",
                                 DateTime.Parse(objxljc.dtCheckDate).ToString("yyyy-MM-dd"),
                                 objxljc.dtBeginTime,
                                 objxljc.dtEndTime,
                                 float.Parse(objxljc.StdValCO2).ToString("0.00"),
                                 float.Parse(objxljc.StdValNO).ToString("0.00"),
                                 float.Parse(objxljc.StdValNO2).ToString("0.00"),
                                 float.Parse(objxljc.CheckValCO2).ToString("0.00"),
                                 float.Parse(objxljc.CheckValNO).ToString("0.00"),
                                 float.Parse(objxljc.CheckValNO2).ToString("0.00"),
                                "1",
                                 m_mainform.sczyxx.Length < 1 ? m_mainform.InspectionOperator : m_mainform.sczyxx);

            m_vesd.Url = m_mainform.surl;
            string sgc005 = m_vesd.write(vehispara);
            m_mainform.writetext("氮氧化合物", vehispara, m_mainform.slicense);
            m_mainform.writetext("氮氧化合物返回", m_mainform.decode(sgc005), m_mainform.slicense);

            return m_mainform.decode(sgc005);
        }

        public override string uploadzj(model.尾气自检.btgydjjc objzjsj)//烟度校准 BD000 6
        {
            string bdnr = string.Format(@"
            <btgydsdz1>{0}</btgydsdz1>
            <btgydscz1>{1}</btgydscz1>
            <btgydwcz1>{2}</btgydwcz1>
            <btgydsdz2>{3}</btgydsdz2>
            <btgydscz2>{4}</btgydscz2>
            <btgydwcz2>{5}</btgydwcz2>
            <btgydsdz3>{6}</btgydsdz3>
            <btgydscz3>{7}</btgydscz3>
            <btgydwcz3>{8}</btgydwcz3>",
            objzjsj.CheckVal0,
            objzjsj.StdVal0,
            objzjsj.AbssoluteVal0,
            objzjsj.CheckVal100,
            objzjsj.StdVal100,
            objzjsj.AbssoluteVal100,
            objzjsj.CheckVal100,
            objzjsj.StdVal100,
            objzjsj.AbssoluteVal100);
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid></head>",
                                                               m_mainform.organ,
                                                              m_mainform.jkxlh,
                                                               "BD000");
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <sbbh>{0}</sbbh>
                                <bdsj>{1}</bdsj>
                                <bdr>{2}</bdr>
                                <czr>{3}</czr>
                                <bdlx>{4}</bdlx>
			                    <bdnr>{5}</bdnr>
			                    <bdjg>{6}</bdjg>
			                    <tsno>{7}</tsno>
			                    <testlineno>{8}</testlineno>          
                                 </vehispara>
			                    </body>
                                </root>",
                                 m_mainform.scysbbh,
                                 DateTime.Now.ToString("yyyy-MM-dd HH:mm:dd"),
                                 m_mainform.sczyxx.Length < 1 ? m_mainform.InspectionOperator : m_mainform.sczyxx,
                                 m_mainform.sczyxx.Length < 1 ? m_mainform.InspectionOperator : m_mainform.sczyxx,
                                 "06",
                                 bdnr,
                                 "1",
                                 m_mainform.stationCode,
                                 m_mainform.lineCode);

            m_vesd.Url = m_mainform.surl;
            string sgc005 = m_vesd.write(vehispara);
            m_mainform.writetext("烟度校准", vehispara, m_mainform.slicense);
            m_mainform.writetext("烟度校准返回", m_mainform.decode(sgc005), m_mainform.slicense);

            return m_mainform.decode(sgc005);
        }
    }
}
